bsum {cgraph} | R Documentation |
Divide a vector or array in consecutive fixed-sized blocks and sum the elements at each position in these blocks.
bsum(x, block_size = 1)
x, |
numeric vector or array, the object that is summed. |
block_size, |
numeric scalar, the size of each block. Defaults to 1. |
numeric vector. Each 1th element of the vector is the sum of each 1th element of the blocks, the 2nd element of the vector is the sum of each 2nd element of the blocks, and so on.
If x
is an array and block_size
is equal to the size of x
's first dimension, then bsum behaves as rowSums.
Ron Triepels