[Rd] Minimum of an ordered factor
Thaler, Thorn, LAUSANNE, Applied Mathematics
Thorn.Thaler at rdls.nestle.com
Thu Jan 6 15:37:01 CET 2011
Kurt Hornik writes
> >> if (!all(sapply(args, is.ordered)) ||
> >> !all(sapply(level.list, identical, y = level.set))) {
>
> 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]
Yes definitely. This line is in fact just a relic from a previous idea I
had.
> 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.
Sounds reasonable. Ack.
BR Thorn
More information about the R-devel
mailing list