How to check your package with R-devel

September 12, 2012
By

(This article was first published on Nicebread » R, and kindly contributed to R-bloggers)

In response to an update to ggplot2 (now verson 0.9.2) I had to make some minor changes to our package TripleR. The CRAN maintainers also asked to …

Please also fix other issues that may be apparent in checks with a current R-devel.

Now, how can this be done? Here’s my workflow on Mac OS (might be slightly different on Win or Linux):

  1.   Install R-develparallel to your existing (stable) R version
    1.  Before installation, run sudo pkgutil --forget org.r-project.R.Leopard.fw.pkg in the Terminal, otherwise the installer will overwrite your existing version
    2. Rename your R.app and R64.app or move them temporarily into another folder, as the installer of R-devel probably will replace them by new version that are not compatible with your existing stable R version.
  2.   Use RSwitch to change the active R version
  3.   Install packages which your own packages depends on; you have to do it from source, as the binaries for the R-devel do not exist: install.packages("lme4", type="source")
  4.  Check your own package using following flag: R CMD check pkg --as-cran
  5. Check if your package also works on Windows using winbuilder

Furthermore, check whether your package follows the CRAN Repository Policies.

PS: Finally, I managed to get rid of the annoying R CMD check warnings like “no visible binding for global variable ‘x’”. These occured due to the ggplot2 syntax. Here‘s a solution.

To leave a comment for the author, please follow the link and comment on his blog: Nicebread » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.