[R] Load datasets

Hua Liang dickliang911 at gmail.com
Thu Mar 29 17:46:27 CEST 2012


 
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 load this dataset. Because phones  is the
70th dataset in this package, I wrote the following codes. Unfortunately they don’t work. It will be greatly appreciated if someone can help me figure out.
 
alldata = data(package="MASS")
arg = alldata$results[70,3]
ineed <- data(arg, package="MASS")


More information about the R-help mailing list