Created on 2020-03-19 by the reprex package (v0.3.0)
I would expect the last two lines to do the same.
I think the problem is here where the idxs vector is subset. This works well if idxs has nrow(mat) elements, but returns NA if rows is longer than idxs.
If you want, I can draft a quick PR to fix the issue.
Hi Henrik,
I think I found a bug in
rowCollapse
if it is combined with row subsetting:Created on 2020-03-19 by the reprex package (v0.3.0) I would expect the last two lines to do the same.
I think the problem is here where the
idxs
vector is subset. This works well ifidxs
hasnrow(mat)
elements, but returnsNA
ifrows
is longer thanidxs
.If you want, I can draft a quick PR to fix the issue.