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 Hortaeduardo.oliveiraho...@gmail.com To: r-helpr-help@r-project.org Subject: Re: [R] Saving objects inside a list Message-ID: aanlktimbxmr0rusiws1grorhjh=wstofzqdoc-90z...@mail.gmail.com Content-Type: text/plain

Re: [R] Saving objects inside a list

2011-01-04 Thread Eduardo de Oliveira Horta
: [R] Saving objects inside a list Message-ID: aanlktimbxmr0rusiws1grorhjh=wstofzqdoc-90z...@mail.gmail.com Content-Type: text/plain sapply(ls(),get) works fine. Thanks. ps: the as.list and the eapply suggestions didn't work. Hi Eduardo (and all the best for this new year

Re: [R] Saving objects inside a list

2011-01-04 Thread Eduardo de Oliveira Horta
-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 within my RKWard sessions: B = 1000 oblist = as.list(.GlobalEnv) str(oblist) List of 1 $ B:function (value) oblist$B function (value

[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 names as

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 as

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 www...@gmail.comwrote: Try this: sapply(ls(pattern = x|y|z), get, simplify = F) On Mon, Jan 3,

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 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 as follows ls() [1] x y z and suppose I want to put these objects

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 list

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 eduardo.oliveiraho...@gmail.com To: r-help r-help@r-project.org Date: 01/03/2011 11:32 AM Subject: [R] Saving objects inside a list Sent by: r-help-boun...@r

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, any ideas on how to save all

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() [1] x y z

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 jorgeivanve...@gmail.comwrote: Hi Eduardo, Try r - ls() result - sapply(r, get) result HTH, Jorge On Mon, Jan 3, 2011 at 12:25 PM, Eduardo

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 eduardo.oliveiraho...@gmail.com 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)

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(ls(),get) works fine. Thanks. ps