[Rd] 'library' or 'require' call not declared from: 'rgl'

Simon Urbanek simon.urbanek at r-project.org
Thu Oct 30 21:19:57 CET 2014


> On Oct 30, 2014, at 3:11 PM, Michael Friendly <friendly at yorku.ca> wrote:
> 
> I'm checking a new release of vcdExtra via win builder with R-devel 2014-10-29 r66897
> and have run into a Warning I don't know how to fix.
> 
> I have one S3 generic, mosaic3d() that uses rgl and don't want to have rgl always loaded
> via Depends:.  Instead, the mosaic3d.default() method includes
> 
>  if (!require(rgl)) stop("rgl is required")
> 
> This always worked in the past, but in this testing cycle, I got a slew of "no visible global function definition for ..."
> all rgl functions.
> 
> I revised DESCRIPTION to include:
> 
> Imports:  rgl
> 
> and NAMESPACE:
> 
> import(rgl)
> 
> All the "no visible global function definition ..." went away, but I'm stuck with
> 
> * checking dependencies in R code ... WARNING
> 'library' or 'require' call not declared from: 'rgl'
> See the information on DESCRIPTION files in the chapter 'Creating R
> packages' of the 'Writing R Extensions' manual.
> 
> How can I solve this?
> 

Did you intend rgl to be optional? If so, then you should use Suggests: instead. When you use Imports: it will load rgl automatically so require() does't make sense (since it will be always TRUE).

Cheers,
Simon


> -- 
> Michael Friendly     Email: friendly AT yorku DOT ca
> Professor, Psychology Dept. & Chair, Quantitative Methods
> York University      Voice: 416 736-2100 x66249 Fax: 416 736-5814
> 4700 Keele Street    Web:http://www.datavis.ca
> Toronto, ONT  M3J 1P3 CANADA
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 



More information about the R-devel mailing list