matrixStats
matrixStats copied to clipboard
WISH: rowSort
Return value when index.return = TRUE
would be a list of 2 matrices.
I second this. I was going to ask for this myself. Maybe something like this:
- matrixStats::rowOrder returns matrix of indices as per base::order()
- matrixStats::rowSort returns sorted matrix as per base::sort()
- matrixStats::rowOrderSort returns a list containing the above matrices.
Hi @HenrikBengtsson I'm interested in working on this and putting in a PR. The plan would be to:
- Use colRanks/rowRanks as a style-guide
- Copy row or column data into new memory
- Use standard library function
qsort
to sort data in new memory - Make sorting function
NA
aware,na.last
parameter - Copy the results of qsort into the output matrix
Do you see any issue with this? Is there anything to look out for before writing a PR?