sumnrow {exvatools} | R Documentation |
Sum every nth row of a matrix and name the resulting rows
Description
Groups a matrix by rows, summing every Nth
row. Matrix should be multiple
of N
.
Usage
sumnrow(df, N, row_names = NULL)
Arguments
df |
A matrix with named rows and columns. |
N |
Integer, specifying the resulting number or rows. |
row_names |
String vector of length |
Value
A matrix with N
rows, where each row is the sum of every Nth
row
of the original matrix.
Examples
wio <- make_wio("wiodtest", quiet = TRUE)
sumnrow(wio$Y, wio$dims$N, paste0("WLD", "_",
gsub("^D", "", wio$names$n_names)))
[Package exvatools version 0.8.0 Index]