[R] Problem with workspace loading after languageR use

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Jun 15 18:43:33 CEST 2007


Thank you for the example: it has enabled me to test a more comprehensive 
fix for R-patched (soon to be 2.5.1).

You should have got a warning when saving along the lines of

Warning message:
'package:languageR' may not be available when loading in: save(list = 
ls(envir = .GlobalEnv, all.names = TRUE), file = outfile,

The problem is indeed in package languageR, which is creating classes and 
methods in your workspace rather than in its package.  It really should 
not be doing so (it uses setMethod in .First.lib), and I am Cc:ing the 
maintainer in the hope that he will stop doing so.

I also find it hard to believe that

Depends: R (>= 2.4.0), methods, lattice, Matrix, coda, lme4, zipfR, 
cluster, e1071, Design, Hmisc, MASS, rpart

is totally necessary, and suggest that Suggests: is used.



On Fri, 15 Jun 2007, Pfister wrote:

> Dear Brian,
>
> thanks a lot for your advice.
>
> Prof Brian Ripley wrote:
>> On Fri, 15 Jun 2007, Prof Brian Ripley wrote:
>> 
>>> 
>>> I think adding the following to your new session before load() will help
>>> 
>>> findPackageEnv <- function(info)
>>>   as.environment(paste("package", "info", sep=":"))
>
> this does not work.
>
>> 
>> more likely
>> 
>> findPackageEnv <- function(info) as.environment(info)
>
> this works, if I load the languageR library before.
>
>> 
>> is correct.
>>> 
>>> will work, but if not try
>>> 
>>> findPackageEnv <- function(info) .GlobalEnv
>
> this works unconditionally. Including that line in a local .RProfile file, 
> basically solves the problem.
>
>>> 
>>> If you send me the problematic workspace (or reproduction instructions) I 
>>> can take a closer look.
>
> A typical session would look like this (using example data from Hox(2002)):
>
> # from Hox (2002)
> hoxpop <- read.table("http://www.ruediger-pfister.de/download/popular.dat", 
> header=TRUE)
> hoxpop$PUPIL <- factor(hoxpop$PUPIL)
> hoxpop$SCHOOL <- factor(hoxpop$SCHOOL)
> hoxpop$SEX <- factor(hoxpop$SEX)
>
> # load languageR
> library(languageR)
>
> # do some analyses ...
>
> # save the workspace
> save.image("D:\\statistics\\MultilevelAnalysis\\lm.RData")
>
>
> After quitting R, the workspace "lm.RData" will not reload.
> (this workspace can be downloaded here: 
> http://www.ruediger-pfister.de/Downloads/lmRData.zip)
>
>
> best
> Rüdiger
>
>
>
>>> 
>>> 
>>> On Fri, 15 Jun 2007, Pfister wrote:
>>> 
>>>> Hello R,
>>>> 
>>>> To analyze multi-level data, I started learning and using lmer. So far
>>>> so wonderful. I then found some useful functions in package languageR.
>>>> But then the following problem ocurred: Whenever I load and use the
>>>> languageR package, then save the workspace - or quit R with saving the
>>>> workspace - I am unable to reload that workspace in a later session.
>>>> That is, R doesn't start at all when I try to start it by clicking the
>>>> workspace file.
>>>> Loading languageR before loading the workspace doesn't help, but yields
>>>> the message:
>>>> 
>>>> Error in load("D:\\statistics\\MultilevelAnalysis\\.RData") :
>>>>         could not find function "findPackageEnv"
>>>> 
>>>> Thus, the saved workspace remains inaccessible. I not 100% certain that
>>>> languageR is the scapegoat, but my trial-and-error experiments indicate
>>>> it is.
>>>> 
>>>> My system is Win XP Home/Professional:
>>>> 
>>>> > sessionInfo()
>>>> R version 2.5.0 Patched (2007-04-24 r41305)
>>>> i386-pc-mingw32
>>>> locale:
>>>> LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252 
>>>> attached base packages:
>>>> [1] "splines"   "stats"     "graphics"  "grDevices" "utils"
>>>> [6] "datasets"  "methods"   "base"
>>>> other attached packages:
>>>>   languageR       rpart        MASS      Design    survival
>>>>       "0.2"    "3.1-36"    "7.2-34"    "2.0-12"      "2.31"
>>>>       Hmisc       e1071       class     cluster       zipfR
>>>>     "3.3-2"    "1.5-16"    "7.2-34"    "1.11.7"     "0.6-0"
>>>>        lme4        coda      Matrix     lattice
>>>> "0.99875-1"    "0.11-2" "0.99875-2"    "0.15-8"
>>>> 
>>>> 
>>>> thanks for any helpful suggestions!
>>>> 
>>>> best
>>>> Rüdiger
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
>
>

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


More information about the R-help mailing list