[R] Saving objects inside a list

William Dunlap wdunlap at tibco.com
Mon Jan 3 18:55:28 CET 2011


> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of Eduardo de 
> Oliveira Horta
> Sent: Monday, January 03, 2011 9:25 AM
> To: r-help
> Subject: [R] Saving objects inside a list
> 
> Hello there,
> 
> any ideas on how to save all the objects on my workspace inside a list
> object?

Does
  as.list(.GlobalEnv)
do what you want?

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com  

> 
> For example, say my workspace is as follows
> ls()
> [1] "x" "y" "z"
> 
> and suppose I want to put these objects inside a list object, say
> 
> object.list <- list()
> 
> without having to explicitly write down their names as in
> 
> object.list$x = x
> object.list$y = y
> object.list$z = z
> 
> Is this possible?
> 
> Thanks in advance,
> 
> Eduardo Horta
> 
> 	[[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.
> 



More information about the R-help mailing list