GDP_dollar already read as numeric by fread. If this may not be the case, better way to handle this is to include colClasses = list(numeric = 'GDP_dollar').
latest_date unused in this script
index in fread is a recent feature I believe. Can revert if prefer a less bleeding-edge dependency.
round(.SD) was 1/2 as fast as lapply(.SD, round) for me
if not using any of the other options to predict.lm, can just access the stored fitted.values directly from the lm object
iso_a3 %in% regression_countries in line 50 is redundant to the same in line 45. If there for emphasis, can use intersect(regression_countries, big_mac_countries) to skip the potential double vector scan
GDP_dollar
already read asnumeric
byfread
. If this may not be the case, better way to handle this is to includecolClasses = list(numeric = 'GDP_dollar')
.latest_date
unused in this scriptindex
infread
is a recent feature I believe. Can revert if prefer a less bleeding-edge dependency.round(.SD)
was 1/2 as fast aslapply(.SD, round)
for mepredict.lm
, can just access the storedfitted.values
directly from thelm
objectiso_a3 %in% regression_countries
in line 50 is redundant to the same in line 45. If there for emphasis, can useintersect(regression_countries, big_mac_countries)
to skip the potential double vector scan