growth {businessPlanR}R Documentation

Growth of a numeric vector

Description

Calculates the differences between consecutive values in a numeric vector.

Usage

growth(x, round = c("round", "ceiling", "floor"), digits = 0, init = x[1])

Arguments

x

A numeric vector.

round

One of "round" (invokes round on x before calculation), "ceiling" (calling ceiling), or "floor" (calling floor instead of round, respectively).

digits

Integer, passed to round if round="round".

init

Numeric, the initial value to compare the first element of x to.

Value

A numeric vector the same length as x.

Examples

growth(c(1,10,12,15,122))

[Package businessPlanR version 0.1-0 Index]