简体   繁体   中英

Lazy loading error in R package

I am building R package in R version 3.1.3, but whenever i try to install it I get the following error message;

* installing *source* package ‘SPO’ ...
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
Error : argument "data" is missing, with no default
Error : unable to load R code in package ‘SPO’
ERROR: lazy loading failed for package ‘SPO’
* removing ‘/home/evans/Desktop/SPO.Rcheck/SPO’

Kindly any help on how to fix lazy loading problem will be highly appreciated. Thank you.

This error message also occurs if you have uncommented code in the function file that is outside of the function definition.

The solution is to comment out, or delete, the code that is not inside your function.

In my case, I found an inactive/unused R file in the R folder of the package I wanted to build.

Once I deleted/removed this file, I was able to build the package.

The error is usually caused by missing arguments (as stated in the comments) or packages.

For example, I had the following in my package:

library("DESeq2")

I couldn't build and install my package because the package DESeq2 was not installed. Once I installed the package, everything worked.

Inspired by madsR suggestion I have deleted .RData and .Rhistory files from the package folder. Then the error kindly disappeared.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM