growthPheno (version 2.1.23)

cumulate: Calculates the cumulative sum, ignoring the first element if exclude.1st is TRUE

Description

Uses cumsum to calculate the cumulative sum, ignoring the first element if exclude.1st is TRUE.

Usage

cumulate(x, exclude.1st = FALSE, na.rm = FALSE, ...)

Value

A vector containing the cumulative sum.

Arguments

x

A vector containing the values to be cumulated.

exclude.1st

A logical indicating whether or not the first value of the cumulative sum is to be NA.

na.rm

A logical indicating whether NA values should be stripped before the computation proceeds

...

allows passing of arguments to other functions; not used at present.

Author

Chris Brien

See Also

Examples

Run this code
data(exampleData)
PSA.cum <- cumulate(longi.dat$PSA)

Run the code above in your browser using DataLab