[datatable-help] data.table packaged code throws error

Matthew Dowle mdowle at mdowle.plus.com
Tue Jan 3 00:47:22 CET 2012


Hi. This is a familiar challenge with R CMD check; e.g.

http://stackoverflow.com/questions/8096313/no-visible-binding-for-global-variable-note-in-r-cmd-check/8096882#8096882

But the error :

   Error in myValidation(consumption, othercolumn) : 
   >   object 'consumption' not found

seems different. Does FAQ 1.6 help?

Matthew

On Mon, 2012-01-02 at 00:24 -0800, AdamMarczak wrote:
> Dear All,
> 
> I have created code that successfully runs 100% of time. When a new session
> is started and I source code like:
> 
> source('C:/path/to/my/code/myScript.R');
> 
> And then call function
> 
> myFunction();
> 
> It runs successfuly
> 
> but when I package code using below code
>  
> package.skeleton( 
>     name = "mgrpoc", 
>     code_files = 'C:/path/to/my/code/myScript.R', 
>     path = "'C:/path/to/my/code/'" 
> ) 
> 
> and check package using CHECK utility I got message
> "myFunction: no visible binding for global variable 'consumption'"
> 
> Where consumption is one of data.table columns used in code as follows
> dt <- data.table(myTable);
> sumByGroup <- dt[,myValidation(consumption, othercolumn),
> by=list(dt$column)]
> 
> And so I package code using command
> C:/R/R.14-1/bin/R.exe CMD INSTALL --build "C:/path/to/my/code/mgrpoc"
> 
> Finally when I start R session and run code 
> library(mgrpoc)
> myFunction()
> 
> I get following error
> Loading required package: RODBC
> Loading required package: data.table
> data.table 1.7.7  For help type: help("data.table")
> Error in myValidation(consumption, othercolumn) : 
>   object 'consumption' not found
> Timing stopped at: 0 0 0 
> > 
> 
> Anyone would be any help here?
> 
> Any help is greatly appreciated.
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/data-table-packaged-code-throws-error-tp4252693p4252693.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help




More information about the datatable-help mailing list