bsum: Block Summation

Description Usage Arguments Value Note Author(s)

View source: R/internal.R

Description

Divide a vector or array in consecutive fixed-sized blocks and sum the elements at each position in these blocks.

Usage

1
bsum(x, block_size = 1)

Arguments

x,

numerical vector or array, the object that is summed.

block_size,

numerical scalar, the size of each block. Defaults to 1.

Value

numerical vector.

Note

If x is an array and block_size is equal to the size of x's first dimension, then bsum behaves as rowSums.

Author(s)

Ron Triepels


triepels/cgraph documentation built on April 24, 2020, 12:58 a.m.