Hi I want to simulate random numbers normal distributed with this size (2000,10000). I tried this but my computer exhaust there is a fast way to make it? randz<-matrix(rnorm(2000000),2000,10000) [[alternative HTML version deleted]]
Hi, On Jul 16, 2009, at 4:54 PM, Jose Narillos de Santos wrote:> Hi I want to simulate random numbers normal distributed with this size > (2000,10000). > > I tried this but my computer exhaust there is a fast way to make it? > > > randz<-matrix(rnorm(2000000),2000,10000)I'll refrain from asking if you really need/want to do that, so I'll just suggest that as a start you could look at the "bigmemory" package for an alternative way to deal with massive matrices: http://cran.r-project.org/web/packages/bigmemory/index.html -steve -- Steve Lianoglou Graduate Student: Physiology, Biophysics and Systems Biology Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
When I try this:> tmp <- randz<-matrix(rnorm(2000000),2000,10000) > dim(tmp)[1] 2000 10000 It gives a result in less than one second. Very quick. And the resulting matrix is not alarmingly big. There must be some other problem. Perhaps your computer has only a very small amount of memory? Ask again, and this time include any error messages. -Don At 10:54 PM +0200 7/16/09, Jose Narillos de Santos wrote:>Hi I want to simulate random numbers normal distributed with this size >(2000,10000). > >I tried this but my computer exhaust there is a fast way to make it? > > >randz<-matrix(rnorm(2000000),2000,10000) > > [[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.-- -------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA 925-423-1062
Don MacQueen wrote:> > When I try this: > >> tmp <- randz<-matrix(rnorm(2000000),2000,10000) >> dim(tmp) > [1] 2000 10000 > > It gives a result in less than one second. Very quick. And the > resulting matrix is not alarmingly big. > > There must be some other problem. Perhaps your computer has only a > very small amount of memory? > >> print(object.size(randz),units="Mb")152.6 Mb Once upon a time this would have been a big object, but not really any more ... What do you get with gc() ? Do you have lots of other stuff lying around in your workspace? -- View this message in context: http://www.nabble.com/rnorm-tp24524329p24527925.html Sent from the R help mailing list archive at Nabble.com.