Re: [R] Saving R objects

From: Nair, Murlidharan T <mnair_at_iusb.edu>
Date: Tue 25 Jul 2006 - 03:25:29 EST

I explicitly did is this way  

isoforms<-as.vector(rownames(mult.comp$estimate)) estimate<-as.vector(mult.comp$estimate)
lower<-as.vector(mult.comp$conf.int[,1]) upper<-as.vector(mult.comp$conf.int[,2])

p.val.raw<-as.vector(mult.comp$p.value.raw)
p.val.bon<-as.vector(mult.comp$p.value.bon)
p.val.adj<-as.vector(mult.comp$p.value.adj) 
out.data.mat<-cbind(isoforms,estimate,lower,upper,p.val.raw,p.val.bon,p.val.adj) write.table(out.data.mat, file=filename.csv, sep=",", qmethod="double", col.name=NA)

Thanks ../Murli


From: Gabor Grothendieck [mailto:ggrothendieck@gmail.com] Sent: Sun 7/23/2006 10:11 PM
To: Nair, Murlidharan T
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Saving R objects

It depends on what information you want to save and how the program on the other end needs it.

For the save version I would at least use ascii = TRUE to get it in a more readable fashion.

Look at

file.show("mult_test.dat")
file.show("mult.out") # but use ascii=TRUE on your save statement.

to see what you are getting.

Other possibilities are to use R2HTML or XML packages to output to HTML or XML. You might want to handle the various components of Dcirec separately. To see what's inside:

   unclass(Dcirec)
   str(Dcirec)
   dput(Dcirec)

and use cat statements to output the components in the format of your choice possibly in conjunction with sprintf.

On 7/23/06, Nair, Murlidharan T <mnair@iusb.edu> wrote:
> I am trying to find the best way to save the follwoing object I am creating
>
> library(multcomp)
> data(recovery)
> Dcirec<-simint(minutes~blanket, data=recovery, conf.level=0.9, alternative="less")
>
> I am probably not doing it the most efficient way I think.
> Here is what I am doing
>
> a<-print(Dcirec)
> write(a,file="mult_test.dat", append=T)
> or
> save(Dcirec, file="mult.out")
>
> Which is the best way to save it, so that I can access its contents outside the R environment?
>
> ______________________________________________
> R-help@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.
>



R-help@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. Received on Tue Jul 25 03:36:01 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 25 Jul 2006 - 06:22:20 EST.

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