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 ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel