Learn R Programming

gmatrix (version 0.3)

gsumby: Sumby

Description

Find sub-sums of a gvector

Usage

gsumby(v, startPos, stopPos)

Arguments

v
a gvector
startPos
a vector of start positions
stopPos
a vector of stop positions

Value

returns a gvector object of the same length as startPos and stopPos. Each element is the sum of elements in v.

Details

startPos and stopPos must be of the same length.

Examples

Run this code
gsumby(g(1:10), c(1,6), c(5,10)) # g(c(15,40))

Run the code above in your browser using DataLab