Description Usage Arguments Value Examples
View source: R/sample_per_decrease.R
A Function to Sample the Annual Percentage Decrease with Uncertainty
1 2 | sample_per_decrease(df, max_year = NULL, min_year = NULL,
samples = 100, years_to_avg = 3)
|
df |
A dataframe containing a year variable and with the second variable being the one to sample from. |
max_year |
Numeric, set as greater than the maximum year in the dataframe if interested in projection.
Defaults to |
min_year |
Numeric, set as smaller than the minimum year in the dataframe if interested in backwards projection.
Defaults to |
samples |
Numeric, the number of samples to take. |
years_to_avg |
Numeric, the number of years over which to average the percentage decrease when estimating the ongoing percentage decrease. |
A dataframe containing annual percentage decrease samples.
1 2 3 | df <- data.frame(year = c(2000:2010), measure = seq(10, 110, 10))
sample_per_decrease(df, samples = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.