On Fri, 12 Dec 2008 18:27:02 +0100, hadley wickham <h.wick...@gmail.com> wrote:


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

or this is already too far?

This would be a considerable extension because then the selector would
need to know about all other variables in the dataset, and you'd need
someway of combining selectors with logical vectors.

If selector returns a logical vector then I really don't see where is the problem. Probably I am mistaken but 
implementing mtcars[cyl>3] is not such a big deal. Just an operator `[.` start searching for "cyl" 
from inside the "x" frame and not from parent.frame as it does now. It is just like putting 
"with" inside '[', or not?

When started with R I was really disappointed that such a natural and intuitive 
subsetting  is not allowed, but instead lengthy and ackward 
mtcars[mtcars$syl>3] is required.

R is an interactive language for 99% of the users and features like that(and 
selectors indeed) would make a tremendous difference.

Regards,
SV.

______________________________________________
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