On Fri, 12 Dec 2008 17:38:13 +0100, hadley wickham <h.wick...@gmail.com> wrote:

You could also imagine similar iterators for random sampling, like
samp(0.2) to choose 20% of the indices, or boot(0.8) to choose 80%
with replacement.  first(n) could also be useful, selecting the first
min(n, length(vector)) observations.   An iterator version of rev()
would also be handy.

Maybe selector would be a better name than iterator though, as these
don't have the same feel as iterators in other languages.

That is really something!! Real high level language!!
"Selectors" could depend on named variables in data frame as well:

mtcars[sel(cyl>3)&last(5)]
mtcars[sel(cyl>3)&boot(80%)]

or may be just
mtcars[cyl>3&last(20)]

or this is already too far?


VS.

______________________________________________
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