metis.readgcam: metis.readgcam

Description Usage Arguments Value

View source: R/metis.readgcam.R

Description

This function connects to a gcamdatabase and uses a query file to out results into a table ready for plotting.

Usage

1
2
3
4
5
metis.readgcam(gcamdatabasePath, gcamdatabaseName,
  queryxml = "metisQueries.xml", scenOrigNames, scenNewNames = NULL,
  reReadData = T, dataProj = "dataProj.proj",
  dirOutputs = paste(getwd(), "/outputs", sep = ""),
  regionsSelect = NULL, queriesSelect = "All", paramsSelect = "All")

Arguments

gcamdatabasePath

Path to gcam database folder

gcamdatabaseName

Name of gcam database

queryxml

Full path to query.xml file

scenOrigNames

Original Scenarios names in GCAM database in a string vector. For example c('scenario1','scenario2).

scenNewNames

New Names which may be shorter and more useful for figures etc. Default will use Original Names. For example c('scenario1','scenario2)

reReadData

If TRUE will read the GCAM data base and create a queryData.proj file in the same folder as the GCAM database. If FALSE will load a '.proj' file if a file with full path is provided otherwise it will search for a dataProj.proj file in the existing folder which may have been created from an old run.

dataProj

Optional. A default 'dataProj.proj' is produced if no .Proj file is specified.

dirOutputs

Full path to directory for outputs

regionsSelect

The regions to analyze in a vector. Example c('Colombia','Argentina')

queriesSelect

Default = "All". Vector of queries to read from the queryxml for example c("Total final energy by aggregate end-use sector", "Population by region"). The queries must be availble in the queryxml file. Current list of queries and generated paramaters are:

  • "Total final energy by aggregate end-use sector". Parameters generated: finalNrgbySec.

  • "primary energy consumption by region (direct equivalent)". Parameters generated: primNrgConsumByFuel

  • "Electricity generation by aggregate technology". Parameters generated: elecByTech

  • "water withdrawals by sector". Parameters generated: watWithdrawBySec

  • "water consumption by sector". Parameters generated: watConsumBySec

  • "water withdrawals by crop". Parameters generated: watWithdrawByCrop

  • "biophysical water demand by crop type and land region". Parameters generated: watBioPhysCons

  • "water withdrawals by water mapping source". Parameters generated: irrWatWithBasin

  • "water consumption by water mapping source". Parameters generated: irrWatConsBasin

  • "GDP per capita MER by region". Where MER is "Market Exchange Rate". Parameters generated: gdpPerCapita.

  • "GDP MER by region". Where MER is "Market Exchange Rate". Parameters generated: gdp, gdpGrowthRate

  • "Population by region". Parameters generated: pop.

  • "ag production by tech". Where technologies signify irrigated or rainfed. Parameters generated: agProdbyIrrRfd

  • "Ag Production by Crop Type". Parameters generated: agProdBiomass, agProdForest, agProdByCrop

  • "land allocation by crop and water source". Parameters generated: landIrrRfd

  • "aggregated land allocation". Parameters generated: aggLandAlloc

  • "Land Use Change Emission". Parameters generated: LUCemissFut

  • "CO2 Emissions by enduse". Parameters generated: co2emission, co2emissionByEndUse,

  • "GHG emissions by subsector". Parameters generated: ghgEmissByGHGGROUPS, ghgEmissionByGHG

paramsSelect

Default = "All". If desired select a subset of paramaters to analyze from the full list of parameters: c("finalNrgbySec", "primNrgConsumByFuel", "elecByTech", "watConsumBySec", "watWithdrawBySec", "watWithdrawByCrop", "watBioPhysCons", "irrWatWithBasin","irrWatConsBasin", "gdpPerCapita", "gdp", "gdpGrowthRate", "pop", "agProdbyIrrRfd", "agProdBiomass", "agProdForest", "agProdByCrop", "landIrrRfd", "aggLandAlloc", "LUCemiss", "co2emission", "co2emissionByEndUse", "ghgEmissionByGHG", "ghgEmissByGHGGROUPS")

Value

A list with the scenarios in the gcam database, queries in the queryxml file and a tibble with gcam data formatted for metis charts.


zarrarkhan/srn documentation built on May 21, 2019, 4:07 a.m.