Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lazy loading error in R package

Tags:

r

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.

like image 692
Evans Otieno Avatar asked Aug 20 '15 15:08

Evans Otieno


2 Answers

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.

like image 21
madsR Avatar answered Oct 07 '22 15:10

madsR


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.

like image 154
hackR Avatar answered Oct 07 '22 14:10

hackR