A function for constructing year to year change
chConstruct(
data,
origVar,
country = "FAOST_CODE",
year = "Year",
newVarName = NA,
n = 1
)
A data frame containing the computed year to year change rate.
The data frame containing the data
The variable in which the year to year change is to be calculated
The column representing the index of country.
The column represing the index of year.
The name assigned to the new variable, if missing then .CH will be appended.
The period for the change rate to be calculated.