[R] problems saving and loading (PLMset) objects

James W. MacDonald jmacdon at med.umich.edu
Tue Jul 31 17:11:04 CEST 2007


 > library(affyPLM)
 > data(Dilution)
 > pset <- fitPLM(Dilution)
 > save(pset, file="tmp.Rdata")
 > q()
## restart R
 > library(affyPLM)
 > load("tmp.Rdata") ## use load() correctly
 > class(pset)
[1] "PLMset"
attr(,"package")
[1] "affyPLM"
 > erm <- load("tmp.Rdata") ## use load() incorrectly
 > class(erm)
[1] "character"

Best,

Jim




Quin Wills wrote:
> Erm, Jim I am loading in the affyPLM package first (when needed) and this
> was a question based on loading/saving R objects. PLMset was an example.
> 
> Many thanks,
> Quin
> 
> 
> -----Original Message-----
> From: James W. MacDonald [mailto:jmacdon at med.umich.edu] 
> Sent: 31 July 2007 14:54
> To: Quin Wills
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] problems saving and loading (PLMset) objects
> 
> Hi Quin,
> 
> First off, you should ask questions about Bioconductor packages on the 
> BioC listserv rather than R-help.
> 
> Anyway, I don't think your PLMset objects are coming out all wrong - it 
> doesn't appear that you are loading the affyPLM package first, which is 
> required for R to know anything about the PLMset object (this object is 
> defined in affyPLM, so without the package R has no idea what it is).
> 
> Best,
> 
> Jim
> 
> 
> 
> Quin Wills wrote:
>> Hi
>>
>>  
>>
>> I'm running the latest R on a presumably up to date Linux server.
>>
>>  
>>
>> 'Doing something silly I'm sure, but can't see why my saved PLMset objects
>> come out all wrong. To use an example:
>>
>>  
>>
>> Setting up an example PLMset (I have the same problem no matter what
> example
>> I use)
>>
>>> library(affyPLM)
>>> data(Dilution) # affybatch object
>>> Dilution = updateObject(Dilution)
>>> options(width=36)
>>> expr <- fitPLM(Dilution)
>>  
>>
>>  
>>
>> This works, and I'm able to get the probeset coefficients with
> coefs(expr).
>> until I save and try reloading:
>>
>>> save(expr, file="expr.RData")
>>> rm(expr) # just to be sure
>>> expr <- load(expr.RData)
>>  
>>
>>  
>>
>> Now, running coefs(expr) says:
>>
>>> Error in function (classes, fdef, mtable) : unable to find an inherited
>> method for function "coefs", for signature "character"
>>
>>  
>>
>>  
>>
>> Trying str(exp) just gives the following:
>>
>>> chr "exp"
>>  
>>
>> expr.Rdata appears to save properly (in that there is an actual file with
>> notable size in my working directory).
>>
>>  
>>
>> Thanks in advance,
>>
>> Quin
>>
>>  
>>
>>  
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at stat.math.ethz.ch 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.
> 

-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the R-help mailing list