View source: R/diff_variables.R
diff_variables | R Documentation |
Produces the first difference of variables in a time-series object or in a list of named time-series objects.
diff_variables(data, variables = NULL, multi = NULL)
data |
a named time-series object or a list of named time-series objects. |
variables |
a character vector of variables that should be differenced, if
they appear in a time-series object. If |
multi |
optional. Numeric by which the differenced series should be multiplicated. |
A differenced time-series object or a list of differenced time-series objects.
# Load data
data("gvar2019")
country_data <- gvar2019$country_data
# Take first difference of the variables "y" and "Dp" across all
# elements of object "country_data" and multiply them by 100
country_data <- diff_variables(country_data, variables = c("y", "Dp"), multi = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.