Re: [R] sample from very large distribution

2010-09-29 Thread Charles C. Berry
On Thu, 30 Sep 2010, Matthew Finkbeiner wrote: I don't have enough RAM for this problem, so I need a work around. This is what I want to do: y<- sample(2^32, 10, replace=FALSE) y <- trunc(runif( 10, 1, 2^32+1)) while( any( dup.y <-duplicated(y) ) ) y[dup.y] <- trunc(

[R] sample from very large distribution

2010-09-29 Thread Matthew Finkbeiner
I don't have enough RAM for this problem, so I need a work around. This is what I want to do: y<- sample(2^32, 10, replace=FALSE) but my machine won't let me do that. so I now do this: x<- seq(1,2^32, by=100) y<- sample(x, 10, replace=FALSE) this works fine, but by selecting every 100