Skip to content
Back to formatted view

Raw Message

Message-ID: <49917782.3080501@idi.ntnu.no>
Date: 2009-02-10T12:48:02Z
From: Wacek Kusnierczyk
Subject: Odp: Problem with retrieving updated variables after	attach()
In-Reply-To: <499171D6.4020601@gmx.ch>

David Croll wrote:
> Well, I knew that attach() only creates a copy of the variables in the
> search path.
>
> What I wanted to ask was how to *retrieve* that copy...
>
> > mat
> id age
> 1 NA  NA
> 2 NA  NA
> 3 NA  NA
> 4 NA  NA
> 5 NA  NA 
> > attach(mat)
>
> > id <<- sample(100,5)
> > age <<- rnorm(5,mean=30)
>
> How can I make a new data frame out of the id and age that were
> changed above?
>

data.frame(id, age) # from the copy
data.frame(mat$id, mat$age) # from the originals

why do you need to overwrite the copy?

vQ