Re: [R] filling data into objects

From: Nair, Murlidharan T <mnair_at_iusb.edu>
Date: Wed, 6 Feb 2008 15:19:23 -0500

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

______________________________________________
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.
Received on Wed 06 Feb 2008 - 20:23:12 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Feb 2008 - 20:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive