Skip to content
Prev 38794 / 63421 Next

Minimum of an ordered factor

I have 3 comments:
Same for me.
I think it would be better to use something like

  ll <- lapply(args, levels)

  !all(sapply(ll, identical, ll[[1L]]))

[using union() is not quite right]
The general comment is that if we support this I don't see why we should
not also support c.ordered (and in fact also c.factor) with the same
restrictions (identical level sequences for ordered and level sets for
factors).  We already have Ops.factor and Ops.ordered using the same
principle afaic.

If we add c.ordered, we should be able to encapsulate the identity of
levels testing into this, and simply use

    x <- c(...)

and then call .Generic on the codes of x etc.

Best
-k