cagr: Compound Average Growth Rate

Description Usage Arguments Details Value Examples

View source: R/cagr.R

Description

cagr calculates compound average growth rate(s) for the vector passed as an argument.

Usage

1

Arguments

x

A vector of numerical values.

matrix

Return a matrix showing cagrs between all vector elements?

time

A vector referring to the time values of x for use in the matrix.

Details

If matrix is equal to TRUE then cagr will return a matrix of calculated cagrs between each numerical value within the vector passed as an argument. If time is NULL, column names will equal to the base value index and row names will equal to the final value index. For example, in the return matrix, if column name = 2 and row name = 5, the resulting value will equal to the cagr between the second and fifth value in the vector x. View examples for more detail.

Value

cagr(s) of vector x.

Examples

1
2
3
cagr(1:10)
cagr(1:10, matrix = TRUE)
cagr(1:10, matrix = TRUE, time = 1991:2000)

faouser1/FAO documentation built on Nov. 4, 2019, 12:35 p.m.