View source: R/augment-ts-growth.R
ts_growth_rate_augment | R Documentation |
This function is used to augment a data frame or tibble with time series
growth rates of selected columns. You can provide a data frame or tibble as
the first argument, the column(s) for which you want to calculate the growth
rates using the .value
parameter, and optionally specify custom names for
the new columns using the .names
parameter.
ts_growth_rate_augment(.data, .value, .names = "auto")
.data |
A data frame or tibble containing the data to be augmented. |
.value |
A quosure specifying the column(s) for which you want to calculate growth rates. |
.names |
Optional. A character vector specifying the names of the new columns to be created. Use "auto" for automatic naming. |
A tibble that includes the original data and additional columns representing
the growth rates of the selected columns. The column names are either
automatically generated or as specified in the .names
parameter.
Steven P. Sanderson II, MPH
Other Augment Function:
ts_acceleration_augment()
,
ts_velocity_augment()
data <- data.frame(
Year = 1:5,
Income = c(100, 120, 150, 180, 200),
Expenses = c(50, 60, 75, 90, 100)
)
ts_growth_rate_augment(data, .value = c(Income, Expenses))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.