The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Converting magpie objects

convertGDP also accepts a magpie object (see the magclass package) for the gdp argument.

library(GDPuc)
if (rlang::is_installed("magclass")) {
  my_gdp <- magclass::new.magpie(
    cells_and_regions = c("USA", "FRA"), 
    years = 2010:2014, 
    names = "gdp",
    sets = c("iso3c", "year", "data"),
    fill = 100:109
  )
  my_gdp
  
  convertGDP(
    gdp = my_gdp, 
    unit_in = "constant 2005 LCU", 
    unit_out = "constant 2017 Int$PPP"
  )
}
#> An object of class "magpie"
#> , , data = gdp
#> 
#>      year
#> iso3c    y2010    y2011    y2012    y2013    y2014
#>   USA 123.2084 125.6726 128.1367 130.6009 133.0651
#>   FRA 150.4810 153.4608 156.4406 159.4204 162.4002

convertGDP does not change or add the “unit” attribute of the magpie object.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.