Skip to content

Loading circular package from Rprofile.site

2 messages · Ved P. Sharma, Brian Ripley

#
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
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
#
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: