Skip to content
Back to formatted view

Raw Message

Message-ID: <AANLkTindeCy1v7a+qPv+ALvGsnazc15=jzz3xoaUC_Jk@mail.gmail.com>
Date: 2011-01-03T21:02:41Z
From: Gabor Grothendieck
Subject: Saving objects inside a list
In-Reply-To: <AANLkTimBXmR0RUSiWs1GrORhJH=WStOfZqdoc-90zx4q@mail.gmail.com>

On Mon, Jan 3, 2011 at 3:58 PM, Eduardo de Oliveira Horta
<eduardo.oliveirahorta at 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)
> as.list(.GlobalEnv)
$DF
  a
1 1
2 2
3 3

$f
function (x)
x

$x
[1] 1

> eapply(.GlobalEnv, identity)
$DF
  a
1 1
2 2
3 3

$f
function (x)
x

$x
[1] 1



-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com