[R] Package check issue: Rprofile.site is not used

From: Sébastien Bihorel <pomchip_at_free.fr>
Date: Thu, 21 Apr 2011 16:48:03 -0400

Dear R-users,

I am having some issues with a package I am working on (using R 2.12.1 in a Linux environment) and would like to have your opinions/advises. My package - let's call it mypackage for the purpose of this email - passes all checks of R CMD check, except for the following failure message:

Error : .onLoad failed in loadNamespace() for 'mypackage', details:   call: source(file = options()$my_path, local = TRUE)   error: invalid connection
Error: package/namespace load failed for 'mypackage' Execution halted

The context is the following:

1- /usr/lib/R/etc/Rprofile.site contains the following line of R code: options(my_path='/some/path/

2- mypackage has a NAMESPACE, and a .onLoad function is included in a zzz.R file. Its content is the following:

.onLoad <- function(libname, pkname) {
  # print(options()) # for testing

3- myf is a function distributed with mypackage. At one point of its execution, this function tries to source /some/path/to/myfile.txt using the following call: source(file = options()$my_path, local = TRUE)

When I start as R session and call 'options()$mypath', I get the expected output: '/some/path/to/myfile.txt'. When I uncomment the 'print(options())' line in .onLoad and try a R CMD check, mypath does not appear as a level of options(). Overall, it looks like my Rprofile.site is not used when R CMD check is run. Is there a way I could request R to use my Rprofile.site during a package check?

Thank you in advance.


        [[alternative HTML version deleted]]

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. Received on Thu 21 Apr 2011 - 20:50:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 22 Apr 2011 - 10:40:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive