-
Notifications
You must be signed in to change notification settings - Fork 3
Package development
R CMD build packageName
R CMD check --as-cran mypackageName_x.y-z.tar.gz
R CMD INSTALL packageName_x.y-z.tar.gz
R CMD build --help
R CMD check --help
R CMD INSTALL --help- Use
R CMD INSTALL --with-keep.sourceor set environment variableR_KEEP_PKG_SOURCE=yesto keep sources.
Try Win-builder for building and checking R source packages for Windows.
Upload a package to CRAN. name:anonymous, pass:my.email.adreess.
ncftp ftp://cran.r-project.org/incoming- Definitely check out Luke Tierney's article in R news "Volume 3/1 June 2003, Name Space Management for R"
- When import namespaces in a NAMESPACE, make sure to add it to Imports section in DESCRIPTION.
- Use LazyData in DESCRIPTION file instead of data(), to avoid "R CMD check returns NOTE about package data set as global variable"
After you modified a .Rd file, you can check the changed .Rd file before installing by
R CMD Rdconv --type=txt snpgrid.Rd
R CMD Rd2pdf pkg-name Use tools::checkRd to check Rd files from within R.
codetools:::checkUsage
setwd("~/dkDNA/man")
filenames <- list.files(pattern="[.]Rd$");
sapply(filenames, FUN=tools::checkRd)When you add new functions to existing packages, source() them, and generate *.Rd files using prompt().
If example codes fail, check out foo.Rcheck/foo-Ex.R by running:
R --vanilla < foo-Ex.R
env LANGUAGE=en R --vanilla --encoding=latin1 < foo-Ex.RByteCompile to 'yes' transforms R code into byte-code (requires lazy-loading). The R interpreter can execute this byte-code more quickly than R code. Byte compilation is expensive and takes more time to install packages. It is said that only very few packages benefit considerably from byte-compilation and many packages benefit from byte-compilation of R itself.
R CMD INSTALL is defined in:
src/library/tools/R/install.RR CMD BUILD is defined in:
src/library/tools/R/build.RPut *.Rnw to vignettes/. To put non-Sweave prebuilt pdf check this page.
?match.call
?hasArg
?missing
?exists
?loadedNamespaces
stopifnot(packageVersion("foo") == "3.14")
stopifnot(compareVersion(packageVersion("foo"), "3.14") < 0)- inst/ directory will be removed once the package is intalled.
- Do not include STOP function in fortran
- Use .Rbuildignore so that R CMD build ignores some directories
- How To Make an R Package Based on C++