Skip to content
Prev 78964 / 398502 Next

Removing and restoring factor levels (TYPO CORRECTED)

On Thu, 2005-10-13 at 10:02 -0400, Duncan Murdoch wrote:
Duncan,

With the predicate that 'master' has the full superset of all possible
factor levels defined, it would seem that this would be a reasonable way
to go.

This approach would also seem to eliminate whatever overhead is
encountered as a result of the coercion of 'x' as a factor to a
character vector, which is done by match().

One question I have is, what is the advantage of using structure()
versus:

   x <- factor(x, levels = levels(master))

?

Thanks,

Marc