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

2010-08-23 Thread peter dalgaard

On Aug 15, 2010, at 8:38 PM, Ben Bolker wrote:

 
  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?


Ben, there is now a dropLevels() _function_ in R-devel, please try it on for 
size.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


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

2010-08-15 Thread Ben Bolker

  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
bbol...@gmail.com , bol...@mcmaster.ca
http://www.math.mcmaster.ca/~bolker
GPG key: http://www.math.mcmaster.ca/~bolker/benbolker-publickey.asc

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel