ecodata_compute_pctchange.Rd
This function calculates the percentage change of a specified variable from the previous year and assigns the same attributes from the original variable to the new one.
ecodata_compute_pctchange(
data,
variable,
new_variable = NULL,
units = "Percent"
)
A data frame containing a "Date" column and the variable of interest.
A string specifying the name of the original variable.
Optional, a string specifying the name of the new variable to store the percentage change. Default will be based on original variable name.
Optional, a string specifying the units for the new variable. Default is "Percent"
An ecodata data frame with the new variable containing the percentage change, with attributes copied.