sumgrows | R Documentation |
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)
df |
A matrix with named rows and columns. |
n |
Integer, specifying the size of each group. |
row_names |
String vector of length n, with names to assign to the resulting rows. |
A matrix where each row is the sum of groups of n rows of the original matrix.
wio <- make_wio("wiodtest", quiet = TRUE)
sumgrows(wio$Y, wio$dims$N, wio$names$g_names)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.