Learn R Programming

BIOdry (version 0.3)

scacum: Scaled-cummulative sums

Description

Cummulative sums of a vector are scaled on a constant value.

Usage

scacum(x, y = NA, z = NA)

Arguments

x
numeric vector with vector names being ordered on time
y
NA or numeric constant to scale the vector. If NA then the cummulative sums are not scaled.
z
NA or numeric constant in range of the vector names. If NA then maximun value in such a range is used.

Value

Details

Cummulative values of the numeric vector are computed with cumsum

Examples

Run this code
x <- c(0.79,0.32,0.53,0.43,0.18)
names(x) <- 1948:1952
y <- 4
z <- 1951
scacum(x,y,z)

##If y = NA then cummulative values are scaled arround
##max(cumsum(x)):
max(cumsum(x))
scacum(x,NA)

Run the code above in your browser using DataLab