growth: Calculate Decimal Growth Rate.

View source: R/growth.R

growthR Documentation

Calculate Decimal Growth Rate.

Description

growth return the decimal growth rate of a numeric vector. It employs data.table:::shift() to achieve the best performance.

Usage

growth(x)

Arguments

x

A numeric vector.

Value

The decimal growth rate of vector x. The first element will be NA.

Examples

growth(c(1, 2, 1))

XiaomoWu/utilr documentation built on July 30, 2022, 11:26 a.m.