Re: [R] Alternative to mapply to select samples

2021-02-04 Thread Chao Liu
1) > > blf <- bl_func() > > set.seed(111) > > blm <- mapply(sample, bl, kn, replace=TRUE) > > all.equal(blf, blm) > [1] TRUE > > > Cheers > Petr > > > -Original Message- > > From: R-help On Behalf Of Chao Liu > > Sent: Tuesday, Fe

Re: [R] Alternative to mapply to select samples

2021-02-03 Thread PIKAL Petr
> -Original Message- > From: R-help On Behalf Of Chao Liu > Sent: Tuesday, February 2, 2021 3:32 PM > To: r-help > Subject: [R] Alternative to mapply to select samples > > Dear R-Help, > > I created a mapply function to select samples from a dataset but are there &g

[R] Alternative to mapply to select samples

2021-02-02 Thread Chao Liu
Dear R-Help, I created a mapply function to select samples from a dataset but are there any faster ways to do it by avoiding mapply because it is slow and I have a larger dataset? My goal is to use more matrix / vector operations and less in terms of lists (the format of the output can be flexible