Market exchange rates do not equalise what money buys. to_ppp() divides a
local-currency series by the PPP conversion factor, putting every country on
comparable international dollars – the correction that makes a cross-country
level comparison meaningful.
Examples
d <- data.frame(iso3c = c("IND", "USA"), year = 2020L,
gdp_lcu = c(1e5, 1e4), ppp = c(21.9, 1))
to_ppp(d, gdp_lcu, factor = ppp)
#> # A tibble: 2 × 5
#> iso3c year gdp_lcu ppp gdp_lcu_ppp
#> <chr> <int> <dbl> <dbl> <dbl>
#> 1 IND 2020 100000 21.9 4566.
#> 2 USA 2020 10000 1 10000
