The behaviour that you get is exactly the behaviour that I, at least,
would expect, and it seems to me to be exactly the correct behaviour.
I do not understand what you are complaining about.
cheers,
Rolf Turner
On 11/04/14 06:31, ivo welch wrote:
I just spent about an hour bug-tracking. I had expected the following to
throw an error:
d <- data.frame( x=1:5, y=6:10 )
valid <- c(TRUE, FALSE)
d[valid,]
I understand that R recycles "when fit," but I had not expected it to
recycle, then truncate, and not give even a warning. maybe there is a good
reason for this.
I would love to be able to teach R to my MFE students. alas, I don't feel
that I can inflict on them the mysterious errors in R. this ranges from
poor checking of when variables exist to auto-recycling (without an ability
to turn this off even with an option) to the non-printing of the last
numbered R source code statement upon an error (that I can see in the
traceback()) to non-expected behavior (e.g., subset(d,x,select=-c("a",
"b"))) to . I know many of these issues can be fixed and/or do not bother
the experts, and I am personally happy to live with R for its power despite
its drawbacks; but IMHO it is just too much to ask from a set of bewildered
novice master students.
I hope the R team will at some point in the future pick up on making the
core language less mysterious upon setting an option, at least in "user
space".
______________________________________________
[email protected] 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.