Skip to content

dropping factor levels in subset

2 messages · Adaikalavan Ramasamy, Douglas Bates

#
Another option is pruneLevels() in library nlme.

x <- factor( c( 0,1,2,1,2 ) )
[1] 0 1 2 1 2
Levels: 0 1 2
[1] 1 2 1 2
Levels: 1 2

-----Original Message-----
From: Marc Schwartz [mailto:mschwartz at medanalytics.com] 
Sent: Saturday, June 28, 2003 2:31 AM
To: 'Prof Brian Ripley'
Cc: r-help at stat.math.ethz.ch; 'Nick Bond'
Subject: RE: [R] dropping factor levels in subset
his
Thanks for the clarifications.

SNIP
find
a
OK.  I initially had the impression that it may have been either
chronologically associated with the addition of this method for
factors or the greater emphasis on R in MASS 4, since it moved from a
footnote to the body. I was wrong. 

Also, I realized a typo in the MASS 4 page number I had above, it
should be 16.

Regards,

Marc

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
#
"Adaikalavan Ramasamy" <gisar at nus.edu.sg> writes:
That function has been removed from the latest release of the nlme
package because it not needed.  All uses of pruneLevels in nlme were
replaced by code of the form

 myfactor[] = myfactor[, drop = TRUE]