[R] filling data into objects
wwwhsd at gmail.com
Wed Feb 6 21:05:39 CET 2008
for(i in 1:100)assign(sprintf("Informative.data.class%s", i),
for(i in 1:100)assign(sprintf("Uninformative.data.class%s", i), rnorm(900))
Or working with a list:
Informative <- replicate(100, rnorm(100, 0.25,1))
Uninformative <- replicate(100, rnorm(900))
On 06/02/2008, Nair, Murlidharan T <mnair at iusb.edu> wrote:
> I am trying to generate artificial data for feature selection. Basically trying to generate a total of 1000 features with 100 that are informative and rest are uninformative.
> Informative.data.class2<-rnorm(100, -0.25,1)
> The above will give me one set of data for the two classes. I am interested in generating about a 100 set for each class. What is a neat way to write it in R?
> Thanks ../Murli
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
25° 25' 40" S 49° 16' 22" O
More information about the R-help