Introduction

This code is used to build, re-build, and trouble shoot the building of the package.

These are mostly commands that can be launched from within RStudio via the GUI, except pkgdown::build_site()

devtools functions

This requires the devtools package.

Vignettes

I build and troubleshoot vignettes by knitting them individually, then when things are running smooth build the package.

Clean vignettes

Cleans up stray files associated vignettes.

devtools::clean_vignettes() 

Build vignettes

devtools::build_vignettes() does the same things call R CMD build

devtools::build_vignettes()

NOTE: The most common error I get here is

This occurs because there’s a pesky bit in the YAML header of Vigenettes

If you copy and paste the YAML header when you make a new vignette, you need to remember change this.

Build documentation

document()

devtools::document(roclets=c('rd', 'collate', 'namespace'))

Load all

devtools::load_all(".")

Check

devtools::check()

check_failures

Explore dependencies

report1 <- CreatePackageReport(pkg_name = "FACavian")

Build pdf manual

https://stackoverflow.com/questions/16986422/r-create-reference-manual-with-r-cmd-check R CMD Rd2pdf mypackage

https://stackoverflow.com/questions/30607496/making-an-r-package-pdf-manual-using-devtools

pack <- "FACavian"
path <- find.package(pack)
system(paste(shQuote(file.path(R.home("bin"), "R")),
    "CMD", "Rd2pdf", shQuote(path)))

remove manual

file.remove("FACavian.pdf")
check(cleanup = FALSE,manual = TRUE,path = getwd())

Keep logs files (?)

options(keep.source.pkgs = TRUE)
devtools::check()

Rcmd.exe

“Clean and rebuild” ==> Rcmd.exe INSTALL –preclean –no-multiarch –with-keep.source mammalsmilk

“Install restart” ==> Rcmd.exe INSTALL –no-multiarch –with-keep.source mammalsmilk

devtools::check(env_vars = )

devtools::check()

See ‘C:/Users/lisanjie/Documents/1_R/git/git-aviary/FACavian.Rcheck/00install.out’ for details. Information on the location(s) of code generating the ‘Note’s can be obtained by re-running with environment variable R_KEEP_PKG_SOURCE set to ’yes’.