Description Usage Arguments Value
View source: R/calc_percent_growth.R
Allows the calculation of percentage change in a variable over user-defined periods of time, on either an absolute basis, or averaged over the course of the period.
1 2 3 4 5 6 7 8 9 10 | calc_percent_growth(
data,
period_col,
start_period,
end_period,
periods,
value_col,
calculation,
...
)
|
data |
Dataframe holding the data you would like to perform the calculation for. |
period_col |
The column containing data for the period the value you are calculating pertains to. |
start_period |
The first period you want to use for your calculations. Must be present in the |
end_period |
The last period you want to use for your calculations. Must be present in the |
periods |
Number of periods covered in the calculation. First period is period 0. |
value_col |
The column containing the value you want to calculate percentage growth for. |
calculation |
Specify whether you would like to calculate growth on an absolute or average per period basis. |
... |
Grouping variables if the data needs to be aggregated. |
A dataframe containing the calculated percentages for the specified grouping variables and periods considered. It will be listed for the start period to the end period.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.