Re: [R] Load datasets

2012-03-29 Thread Hua Liang
Michael is right. I tried and found get() is required for my case. Hua On Mar 29, 2012, at 13:50, "R. Michael Weylandt " wrote: > Yes, but if the OP wants to assign the values to "ineed" (which I think is > the request), he'll need get() > > Michael > > On Mar 29, 2012, at 12:50 PM, David Wi

Re: [R] Load datasets

2012-03-29 Thread David Winsemius
On Mar 29, 2012, at 1:50 PM, R. Michael Weylandt wrote: Yes, but if the OP wants to assign the values to "ineed" (which I think is the request), he'll need get() Perhaps. I assumed he wanted to load 'phones'. (That's what he said he wanted.) If he did this : ineed <- get(data(list = arg)

Re: [R] Load datasets

2012-03-29 Thread R. Michael Weylandt
Yes, but if the OP wants to assign the values to "ineed" (which I think is the request), he'll need get() Michael On Mar 29, 2012, at 12:50 PM, David Winsemius wrote: > > On Mar 29, 2012, at 12:13 PM, R. Michael Weylandt wrote: > >> Perhaps something like > >>> alldata = data(package="MASS"

Re: [R] Load datasets

2012-03-29 Thread David Winsemius
On Mar 29, 2012, at 12:13 PM, R. Michael Weylandt wrote: Perhaps something like alldata = data(package="MASS") arg = alldata$results[70,3] ineed <- data(arg, package="MASS") get(data(list = arg)) I think the get() is superfluous: > rm(phones) > exists("phones") [1] FALSE > data(list=arg

Re: [R] Load datasets

2012-03-29 Thread R. Michael Weylandt
Perhaps something like get(data(list = arg)) 2012/3/29 Hua Liang : > > I am trying to use datasets within R with a loaded package, for example, > MASS. When I use the dataset phones, it can be done using data(phones, > package=”MASS”). I am thinking about an alternative but more flexible way to