Learn R Programming

ebirdst (version 3.2023.1)

convert_ppy_to_cumulative: Convert percent per year trend to cumulative trend

Description

Convert percent per year trend to cumulative trend

Usage

convert_ppy_to_cumulative(x, n_years)

Value

A numeric vector of the same length as x that contains the cumulative trend resulting from n_years years of compounding annual trend.

Arguments

x

numeric; percent per year trend on the 0-100 scale rather than the 0-1 scale.

n_years

integer; number of years.

Examples

Run this code
ppy_trend <- runif(100, min = -100, 100)
cumulative_trend <- convert_ppy_to_cumulative(ppy_trend, n_years = 5)
cbind(ppy_trend, cumulative_trend)

Run the code above in your browser using DataLab