Skip to content

R random number generation

1 message · Mark Leeds

#
below i think semi does what you want but it's never going to repeat a 
value because it's sampling without replacement ? in that sense,
it's not as general as what you asked for. if you need the repeating 
thing, then i'm not sure how to do that. hopefully someone else does.

lapply(1:30, function(.index) {
    sample(1:.index,replace=FALSE,size=.index)
})
On Thu, Oct 23, 2008 at 8:53 PM, hiphop wrote: