[R] The end of Matlab

Vitalie Spinu vitosmail at rambler.ru
Fri Dec 12 18:11:16 CET 2008


On Fri, 12 Dec 2008 17:38:13 +0100, hadley wickham <h.wickham at 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.



More information about the R-help mailing list