HenrikBengtsson/matrixStats

Idea: grouped calculations

Closed this issue · 1 comments

Hello HenRik

In base R, there is this wonderful function rowsum(). It calculates sums of all columns in a matrix, grouped by the unique values of a second argument. It is astonishingly fast. Have you ever thought of implementing something like rowsum, but for other statistics (mean, median, weighted mean, variance) etc.?

  • grouped_rowmean()
  • grouped_colmean()
  • grouped_rowmedian()
  • ...

?

Just detected the "collapse" package from some (other) big names with this functionality (sum, mean, sd, var, count, cumsum, quantile, ...) with or without weights.

Will close this issue.