[R] R CMD CHECK and require() / library() methods
Crispin Miller
CMiller at picr.man.ac.uk
Wed Apr 25 17:27:22 CEST 2007
Many thanks!
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Prof
> Brian Ripley
> Sent: 25 April 2007 16:03
> To: Crispin Miller
> Cc: R-help at stat.math.ethz.ch
> Subject: Re: [R] R CMD CHECK and require() / library() methods
>
> On Wed, 25 Apr 2007, Crispin Miller wrote:
>
> > Hi,
> >
> > I have a piece of code that decides at runtime whether to
> load a data
> > package (and which package to load).
> > This is then done with a call to:
> >
> > library(x)
> >
> > (where x is a character variable containing the package name).
> >
> > This causes R CMD check to throw out a warning:
> > 'library' or 'required' calls not declared from:
> > x
>
> Which version of R is this? All I can find say 'require'.
>
My mistake - it was a typo it says: 'require'
> >
> > Does anyone have any suggestions as to a fix or workaround for this?
>
> That call should be
>
> library(x, character.only=TRUE)
>
> and that will in R 2.5.0 stop the warning AFAIK.
>
It works - much appreciated...
Crispin
--------------------------------------------------------
This email is confidential and intended solely for the use o...{{dropped}}
More information about the R-help
mailing list