tda_msort sorts the rows of X ascending by the
columns named in by, first column first – TDA's
msort, matching
X[do.call(order, as.data.frame(X[, by])), ].
tda_msort1 does the same and then drops consecutive
duplicate rows (comparing every column, not just by) –
TDA's msort1, matching unique(sorted_X).
tda_mrank – despite the name – is not a
linear-algebra matrix rank (no TDA command returns one as a
matrix value; tda_mginv prints a pseudorank as a
side effect, but never returns it). It returns the sort
permutation itself: an integer vector p such that
X[p, ] is sorted by by – TDA's mrank,
which equals base R's
order(X[, by[1]], X[, by[2]], ...), not rank().
Value
tda_msort/tda_msort1 return a matrix;
tda_mrank returns an integer vector, the same length as
nrow(X).
See also
Other matrix reshaping:
tda_mag(),
tda_mcath(),
tda_mcvec(),
tda_mrsum(),
tda_msrow(),
tda_mtrim()