I'm trying to replicate some work and running into a dataframe
error. I'm trying to subset just year 2011 of my data. And show the difference in the lag between my two variables (LnCO & LnPP).
Data Formating for PP Regressions
PP$LnCO_diff1 <- PP$LnCO - PP$LnCO_1
This is the error I am receiving:
Error in `$<-.data.frame`(`tmp`, "LnCO_diff1", value = numeric(0)) : replacement has 0 rows, data has 433
I'm fairly new to R and have no idea. Any help is appreciated!