knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
source
argumentUse the source
argument in convertGDP
to control the source of the underlying conversion factors (GDP deflators, MERs and PPPs). This can be a user-defined object or one of the sources shipped with the package.
Any tibble with columns:
can be used as a source of conversion factors.
library(GDPuc) my_gdp <- tibble::tibble( iso3c = "USA", year = 2010:2014, value = 100:104 ) my_custom_source <- tibble::tibble( iso3c = "USA", year = 2010:2014, "GDP deflator" = seq(1, 1.1, 0.025), "MER (LCU per US$)" = 1, "PPP conversion factor, GDP (LCU per international $)" = 1, ) print(my_custom_source) convertGDP( gdp = my_gdp, unit_in = "constant 2010 LCU", unit_out = "constant 2014 Int$PPP", source = my_custom_source, verbose = TRUE )
There are two source
options shipped with the package, wb_wdi
and wb_wdi_linked
, with wb_wdi
set as the default. Pass the name of a shipped source to the source argument to use it.
convertGDP( gdp = my_gdp, unit_in = "constant 2010 LCU", unit_out = "constant 2014 Int$PPP", source = "wb_wdi_linked", verbose = TRUE )
Use the function print_source_info
to print information on a specific, or all available sources.
print_source_info("wb_wdi") print_source_info()
Use the :::
operator to take a closer look at sources shipped with GDPuc.
GDPuc:::wb_wdi
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.