Re: [R] re-sampling of large sacle data

2010-07-28 Thread David Winsemius
On Jul 28, 2010, at 12:09 AM, jd6688 wrote: d <- apply(s, 2, sample, size = 1*nrow(s), replace = TRUE) why the code above return the following error Error: cannot allocate vector of size 218.8 Mb Possibilities: Your workspace is full of other junk? Your workspace used to be full of oth

Re: [R] re-sampling of large sacle data

2010-07-28 Thread David Winsemius
On Jul 27, 2010, at 6:44 PM, jd6688 wrote: I am trying to do the following to accomplish the tasks, can anybody to simplify the solutions. Thanks, for (i in 1:1){ d<-apply(s,2,sample) pos_neg_tem<-t(apply(d,1,doit)) if (i>1){ pos_neg_pool<-rbind(pos_neg_pool,pos_neg_tem) }else{

Re: [R] re-sampling of large sacle data

2010-07-27 Thread jd6688
d <- apply(s, 2, sample, size = 1*nrow(s), replace = TRUE) why the code above return the following error Error: cannot allocate vector of size 218.8 Mb -- View this message in context: http://r.789695.n4.nabble.com/re-sampling-of-large-sacle-data-tp2304165p2304413.html Sent from the R he

Re: [R] re-sampling of large sacle data

2010-07-27 Thread Joshua Wiley
It looks to me like you keep sampling from some dataset 's' 10,000 times. Since you can sample() with replacement, I wonder if you could just take a sample of the size you want, rather than using a loop with sample. Perhaps along these lines: d <- apply(s, 2, sample, size = 1*nrow(s), replac

Re: [R] re-sampling of large sacle data

2010-07-27 Thread jd6688
I am trying to do the following to accomplish the tasks, can anybody to simplify the solutions. Thanks, for (i in 1:1){ d<-apply(s,2,sample) pos_neg_tem<-t(apply(d,1,doit)) if (i>1){ pos_neg_pool<-rbind(pos_neg_pool,pos_neg_tem) }else{ pos_neg_pool<- pos_neg_tem }} -- View

Re: [R] re-sampling of large sacle data

2010-07-27 Thread Gray Calhoun
Write a function that incorporates "doit" and the column shuffle. Let's call it "doitbetter" replicate(1, doitbetter()) You'll probably want to read the help for "replicate" to make sure the defaults are what you want. --Gray On Tue, Jul 27, 2010 at 4:43 PM, jd6688 wrote: > > myDF: > > d1

[R] re-sampling of large sacle data

2010-07-27 Thread jd6688
myDF: d1 d2 d3 d4 d5 -0.1669103510.022304377 -0.00825924 0.008330689 -0.000925938 -0.1669103510.022304377 -0.00825924 0.008330689 -0.000925938 -0.1669103510.022304377 -0.00825924 0.0