[R] filling data into objects
Nair, Murlidharan T
mnair at iusb.edu
Wed Feb 6 21:19:23 CET 2008
Oh yes, that's what I was looking for. I can then do a
Class1<-rbind(Informative.data, Uninformative.data)
Thanks ../Murli
-----Original Message-----
From: Henrique Dallazuanna [mailto:wwwhsd at gmail.com]
Sent: Wednesday, February 06, 2008 3:06 PM
To: Nair, Murlidharan T
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] filling data into objects
Perhaps:
for(i in 1:100)assign(sprintf("Informative.data.class%s", i),
rnorm(100, 0.25,1))
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.class1<-rnorm(100,0.25,1)
> Uninformative.data.class1<-rnorm(900,0,1)
> Informative.data.class2<-rnorm(100, -0.25,1)
> Uninformative.data.class2<-rnorm(900,0,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
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O
More information about the R-help
mailing list