add_region_ID: Match GCAM ID to region using data from a lookup table.

Description Usage Arguments Details Value

View source: R/gcam_data_processing.R

Description

We match by ID number to avoid problems with variant spellings and the like. With the optional arguments you can also omit regions for which you don't want to plot the data for some reason, and you can translate the abbreviations used in subregion output.

Usage

1
2
add_region_ID(datatable, lookupfile = rgn32, provincefile = NULL,
  drops = NULL, disaggregate = NULL)

Arguments

datatable

A table of results produced by getQuery

lookupfile

Name of one of the predefined map sets, OR, if you're using a custom map set, the file containing the region lookup table

provincefile

Name of one of the predefined map sets, OR, if you're using a custom map set, file containing the province lookup table, if applicable.

drops

Name of one of the predefined map sets, OR, if you're using a custom map set, the file containing a list of regions to drop, if applicable.

disaggregate

A column (or vector of columns) of datatable used to disaggregate regions that are not specified in the original data.

Details

The provincefile and drops arguments are a little clunky. They are optional, but if you are using one of the built-in map sets, then you must not specify them if they don't exist for the map set you are using. Currently, rgn14 and basin235 have neither drops nor province abbreviations. The rgn32 set has drops, but not province abbreviations. Only the chn set has both.

Value

Input table modified to include a GCAM ID for reach region.


JGCRI/gcammaptools documentation built on May 4, 2018, 8 a.m.