Arithmetic mean per row grouped by a factor
row_mean_grouped(x, group)
x
matrix of class dgCMatrix
dgCMatrix
group
factor to group the columns by (will be converted using as.factor and droplevels)
as.factor
droplevels
matrix of arithmetic means