In your code /R, you have these options:
package::object@import package@importFrom package objectYou absolutely cannot use library(package) or require(package) anywhere in /R.
It is OK to use library(package) in vignettes and tests
These fields determine what happens at installation and library ing your package.
Imports: it will be installed along with your package (if needed).Depends: it will be installed, and loaded into the namespace with library when your package is loaded.Thus,
ImportsDependsIt is difficult to keep a large number of objects in working memory
All contribute to the cognitive load
object_verb convention for functionsThe mandatory ‘Package’ field gives the name of the package. This should contain only (ASCII) letters, numbers and dot, have at least two characters and start with a letter and not end in a dot.
Recommendation:
What to number your package? Package numbers conveys information about differences between versions. There are different systems, your should use one:
major.minor.patchapi-change.feature-addition.bugfixesmajor.minor versions to CRAN, and keep patches tracked on github.1.11.1.0.0 to me signifies maturity, I would not rely on a package until it reaches 1.0Principal surrogate evaluation with pseval
surv.fit <- psdesign(fakedata, Z = Z, Y = Surv(time.obs, event.obs),
S = S.obs, BIP = BIP, CPV = CPV) +
integrate_semiparametric(formula.location = S.1 ~ BIP,
formula.scale = S.1 ~ 1) +
risk_exponential(D = 10) + ps_estimate(method = "BFGS") +
ps_bootstrap(n.boots = 20)
surv.fit
plot(surv.fit)
calc_risk(surv.fit, contrast = "TE")Be consistent across multiple entry points
dc
ams
Survigraph/inst subdirectoryAnything in the /inst directory of your package will be copied as-is to the top level directory when the package is installed. It is useful for including things like
Within R you refer to such files with
system.file("path-to-file", package = "packagename")
Should the package exist?