As a minimal working example, I'm trying to import some objects from a package MASSinto my own package (called Test) - take a dataset abbey, for example:
abbey
Package: Test
...
Imports: MASS
import(MASS)
I hit Build & Reloadin RStudio and got an error:
==> devtools::document(roclets=c('rd', 'collate', 'namespace'))
Updating Test documentation
Loading Test
Error in eval(expr, envir, enclos) : object 'abbey' not found
Writing NAMESPACE
Documentation completed
==> Rcmd.exe INSTALL --no-multiarch --with-keep.source Test
* installing to library '.../R/R-3.1.0/library'
* installing *source* package 'Test' ...
** R
** preparing package for lazy loading
Error in eval(expr, envir, enclos) : object 'abbey' not found
Error : unable to load R code in package 'Test'
ERROR: lazy loading failed for package 'Test'
* removing '.../R/R-3.1.0/library/Test'
* restoring previous '.../R/R-3.1.0/library/Test'
Exited with status 1.
It seems that even the most basic one has importfailed - the system cannot find abbey. It is clear that I must lose sight of something obvious - what is wrong?
mchen source
share