Skip to content
Prev 11270 / 63468 Next

matrix coercion, logical -> character

Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
and for apply:

     If 'X' is not an array but has a dimension attribute, 'apply'
     attempts to coerce it to an array via 'as.matrix' if it is
     two-dimensional (e.g., data frames) or via 'as.array'.

explains why apply(...., which) got in trouble
Yes. That was the direction in which I was hinting. It does seem a bit
like a leftover, and applying which() over a set of logical
columns is not unlikely to be useful in practice.