powered by
Groups a matrix by rows, summing blocks of rows of size n each. Matrix rows should be multiple of n.
sumgrows(df, n, row_names = NULL)
A matrix where each row is the sum of groups of n rows of the original matrix.
A matrix with named rows and columns.
Integer, specifying the size of each group.
String vector of length n, with names to assign to the resulting rows.
wio <- make_wio("wiodtest", quiet = TRUE) sumgrows(wio$Y, wio$dims$N, wio$names$g_names)
Run the code above in your browser using DataLab