View source: R/funcs_do_calculation.R
calculate.arr | R Documentation |
The formula for ARR is as follows: ARR = ln(rate2/rate1)/(t2-t1)*-100, where t1 and t2 are years and t1<t2. Return unrounded results
calculate.arr(dt, year1, year2)
dt |
wide data by year, year1 and year2 shall be columns like 1990, 2000 |
year1 |
year1 where year1 < year2 |
year2 |
year2 where year1 < year2 |
dt with added columns named like "1990-2000"
## Not run:
dt_final_ARR <- dt_final[Year%in%c(1990,2019)]
dt_final_ARR_w <- dcast(dt_final_ARR, ISO3Code ~ Year)
dt_final_ARR_w <- calculate.arr(dt_final_ARR_w, 1990, 2019)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.