Re: [R] Saving objects inside a list

2011-01-04 Thread Eduardo de Oliveira Horta
o de > > Oliveira Horta > > Sent: Tuesday, January 04, 2011 6:25 AM > > To: r-help@r-project.org > > Subject: Re: [R] Saving objects inside a list > > > > Hello, (and a happy new year for you too!) > > > > Apparently the problem is happening only withi

Re: [R] Saving objects inside a list

2011-01-04 Thread Eduardo de Oliveira Horta
oblist$B [1] 1000 Problem solved? Best regards, Eduardo Horta On Tue, Jan 4, 2011 at 9:41 AM, Olivier ETERRADOSSI < olivier.eterrado...@mines-ales.fr> wrote: > Message: 42 >> Date: Mon, 3 Jan 2011 18:58:04 -0200 >> From: Eduardo de Oliveira Horta >> >> To: r-

Re: [R] Saving objects inside a list

2011-01-04 Thread Olivier ETERRADOSSI
Message: 42 Date: Mon, 3 Jan 2011 18:58:04 -0200 From: Eduardo de Oliveira Horta To: r-help Subject: Re: [R] Saving objects inside a list Message-ID: Content-Type: text/plain sapply(ls(),get) works fine. Thanks. ps: the as.list and the eapply suggestions didn't work. Hi Eduardo

Re: [R] Saving objects inside a list

2011-01-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Eduardo de > Oliveira Horta > Sent: Monday, January 03, 2011 12:58 PM > To: r-help > Subject: Re: [R] Saving objects inside a list > > sapply(l

Re: [R] Saving objects inside a list

2011-01-03 Thread Gabor Grothendieck
On Mon, Jan 3, 2011 at 3:58 PM, Eduardo de Oliveira Horta wrote: > sapply(ls(),get) works fine. Thanks. > > ps: the as.list and the eapply suggestions didn't work. > They work for me. Starting in a fresh session: > x <- 1; f <- function(x) x; DF <- data.frame(a = 1:3) > as.list(.GlobalEnv) $DF

Re: [R] Saving objects inside a list

2011-01-03 Thread Eduardo de Oliveira Horta
sapply(ls(),get) works fine. Thanks. ps: the as.list and the eapply suggestions didn't work. On Mon, Jan 3, 2011 at 3:56 PM, Jorge Ivan Velez wrote: > Hi Eduardo, > > Try > > r <- ls() > result <- sapply(r, get) > result > > HTH, > Jorge > > > On Mon, Jan 3, 2011 at 12:25 PM, Eduardo de Oliveira

Re: [R] Saving objects inside a list

2011-01-03 Thread Jorge Ivan Velez
Hi Eduardo, Try r <- ls() result <- sapply(r, get) result HTH, Jorge On Mon, Jan 3, 2011 at 12:25 PM, Eduardo de Oliveira Horta <> wrote: > Hello there, > > any ideas on how to save all the objects on my workspace inside a list > object? > > For example, say my workspace is as follows > ls()

Re: [R] Saving objects inside a list

2011-01-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@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, >

Re: [R] Saving objects inside a list

2011-01-03 Thread David L Lorenz
Eduardo, Try this: object.list <- sapply(objects(), function(x) get(x), simplify=F, USE.NAMES=T) Dave From: Eduardo de Oliveira Horta To: r-help Date: 01/03/2011 11:32 AM Subject: [R] Saving objects inside a list Sent by: r-help-boun...@r-project.org Hello there, any ideas on how

Re: [R] Saving objects inside a list

2011-01-03 Thread Henrique Dallazuanna
Remove the pattern argument: sapply(ls(), get, simplify = F) On Mon, Jan 3, 2011 at 3:51 PM, Eduardo de Oliveira Horta < eduardo.oliveiraho...@gmail.com> wrote: > Thanks, but this is still too restrictive... I wanted something that could > actually save objects with arbitrary names inside a lis

Re: [R] Saving objects inside a list

2011-01-03 Thread Gabor Grothendieck
On Mon, Jan 3, 2011 at 12:25 PM, Eduardo de Oliveira Horta wrote: > Hello there, > > any ideas on how to save all the objects on my workspace inside a list > object? > > For example, say my workspace is as follows > ls() > [1] "x" "y" "z" > > and suppose I want to put these objects inside a list o

Re: [R] Saving objects inside a list

2011-01-03 Thread Eduardo de Oliveira Horta
Thanks, but this is still too restrictive... I wanted something that could actually save objects with arbitrary names inside a list object... On Mon, Jan 3, 2011 at 3:39 PM, Henrique Dallazuanna wrote: > Try this: > > sapply(ls(pattern = "x|y|z"), get, simplify = F) > > > On Mon, Jan 3, 2011 at 3

Re: [R] Saving objects inside a list

2011-01-03 Thread Henrique Dallazuanna
Try this: sapply(ls(pattern = "x|y|z"), get, simplify = F) On Mon, Jan 3, 2011 at 3:25 PM, Eduardo de Oliveira Horta < eduardo.oliveiraho...@gmail.com> wrote: > Hello there, > > any ideas on how to save all the objects on my workspace inside a list > object? > > For example, say my workspace is

[R] Saving objects inside a list

2011-01-03 Thread Eduardo de Oliveira Horta
Hello there, any ideas on how to save all the objects on my workspace inside a list object? 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 nam