[R] Variable passed to function not used in function in select=... in subset

hadley wickham h.wickham at gmail.com
Tue Nov 11 15:14:35 CET 2008


> And without wanting to be rude or anything, your opinion carries very
> little weight in a project like R. You've arrived on the list and been
> very critical of the work of others. Now there is nothing wrong with
> being critical if it is constructive, and additionally with something
> like R you need to be constructive *and* contribute back. I'm not saying

You are holding Wacek to a very high standard.  Why is not acceptable
to say that this part of R is hard to understand without having to
provide a better solution?

subset() _is_ confusing to novice R users.  You can not anticipate
what subset(df, select = a) will do unless you know what variables are
defined in the local environment and what variables are defined in the
data frame.  It is hard to understand how it works without a deep
understanding of environments and it is hard to teach all the special
cases.   It is difficult to reliably use subset within another
function.

This comes from my personal experience with subset (good for
interactive use, never program with) and from my experiences teaching
~80 students how to use R over the last two years.

Hadley

-- 
http://had.co.nz/



More information about the R-help mailing list