This is a known bug in the package. It should have used
utils::packageDescription, or imported it in its NAMESPACE. If this was
not condiitonal on interactive() it would have be shown up in the CRAN
package checks.
Rprofile.site is run early in the startup process: it is not really
intended for such things. Use ~/.Rprofile to load packages for your
session.
On 13/01/2013 03:49, Ved P. Sharma wrote:> Hi,
>
> I installed "circular" package and I wanted to load it
automatically
> when R starts up, so I added the following lines in file
> Rprofile.site,
>
> .First <- function()
> library(circular)
>
> When R starts up, it gives me the following error:
> ----------
> Loading required package: boot
> Loading required package: graphics
> Loading required package: stats
> Error : .onAttach failed in attachNamespace() for 'circular',
details:
> call: fun(libname, pkgname)
> error: could not find function "packageDescription"
> Error: package/namespace load failed for ?circular?
> ----------
>
> What's surprising is that instead of loading "circular" from
the
> Rprofile.site, if I run R and load this package
>
>> library(circular)
>
> it works fine and gives me the following message:
> ----------
> Loading required package: boot
> Package 'circular', 0.4-3 (2011-07-18). Type
'help(Circular)' for
> summary information.
> Please report any bugs or comments to <Claudio Agostinelli> claudio
at unive.it
> The package redefine how function 'var' and 'sd' works
> In particular, (try 'methods(var)' and 'methods(sd)')
> notice that 'var.default' ('sd.default')is an alias for
the original
> 'var' ('sd') function
> and that a method for data.frame is available.
>
>
> Attaching package: ?circular?
>
> The following object(s) are masked from ?package:stats?:
>
> sd, var
> ----------
>
> I am puzzled as to why there are different responses to the same
> command? FYI, I am running R version 2.15.2 (2012-10-26) on Windows 7,
> i386-w64-mingw32/i386 (32-bit)
>
> I have other installed packages, which load up fine from the
> Rprofile.site at R startup. The error seems to occur only with
> "circular".
>
> Ved
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595