[Rd] adding a built-in drop.levels option for subset() in 2.12 ?

Ben Bolker bbolker at gmail.com
Sun Aug 15 20:38:19 CEST 2010


  With the approach of R 2.12.0:

  with mild apologies for re-opening this perennial issue:
is there any hope, if appropriate patches are submitted, of adding a
drop.levels argument (with default equal to FALSE to preserve backward
compatibility/efficiency) to the subset function ... ?
  If not, would a patch to the documentation and/or the R FAQ be accepted?

  This does seem to be a continuing source of confusion/frustration (it
certainly is among my students, and here is some documentation from
r-help over the years).  Note that some of the earliest threads here
refer to the problem (now fixed) that the subset() documentation failed
to note that the existing 'drop' argument would *not* (confusingly) drop
unused levels.

http://finzi.psych.upenn.edu/Rhelp10/2008-April/158566.html
http://finzi.psych.upenn.edu/R/Rhelp02/archive/42976.html
http://finzi.psych.upenn.edu/R/Rhelp02/archive/36961.html
http://finzi.psych.upenn.edu/Rhelp10/2009-November/217878.html
http://article.gmane.org/gmane.comp.lang.r.general/200395

  This suggestion is milder and less wide-ranging than a global
drop.unused.levels option, or than convincing everyone to use strings
rather than factors most of the time ...

  cheers
    Ben Bolker


-- 
Ben Bolker
bbolker at gmail.com , bolker at mcmaster.ca
http://www.math.mcmaster.ca/~bolker
GPG key: http://www.math.mcmaster.ca/~bolker/benbolker-publickey.asc



More information about the R-devel mailing list