Hi all,

                I have a dataset. Each time I want to sample N(i) elements from 
it and I want to repeated sampling M times. N(i) is varied from time to time. 
For example,

                dataset = 1:50;
                a = list();

                M = 1000;

                I want to do something like
                for(i in 1:M)

{
                a[[i]] = sample(dataset, sample(length(dataset), 1))
                }

                But my question is that if there is more elegant solution for 
this, for example, without bothering loop, can I do the repeated sampling?

                Many thanks.


HXD

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to