Re: [R] resampling issue

2010-09-29 Thread Dennis Murphy
Hi: The deal with replicate() is that its second argument is a *function*; more specifically, a function *call*. That's why Henrique's solution worked and your attempt didn't. Inside replicate(), if the function has arguments, they need to be supplied. This works: testdat <- function(df, n) df[sa

Re: [R] resampling issue

2010-09-29 Thread Henrique Dallazuanna
I think that you want: replicate(5, growth[sample(9,12,replace=T),], simplify = FALSE) On Wed, Sep 29, 2010 at 3:19 PM, Michael Larkin wrote: > I am trying to get R to resample my dataset of two columns of age and > length > data for fish. I got it to work, but it is not resampling every repli