get_data: Get data from different exvatools objects

View source: R/get_data.R

get_dataR Documentation

Get data from different exvatools objects

Description

Extracts exporting country and sector and destination data from a specific variable in an exvatools object.

Usage

get_data(
  exvatools_object,
  var,
  exporter,
  sector = "TOTAL",
  importer = "WLD",
  demand_comp = "TOTAL",
  custom = FALSE
)

Arguments

exvatools_object

An exvatools object (wio, exvadec or exvadir). If it is an ICIO wio, it will be previously melded (i.e., China and Mexico will be grouped).

var

String for the selected variable included in the exvatools object: "VA", "X", "EXGR", "VAX", "DC", "DVA", etc.

exporter

String vector with codes of the exporting countries.\ If the exvadec object includes only one country or country group, exporter is not required (data can only be extracted for that country).\ If exporter is not specified and it is an exvadir object, the exporter will be considered the world ("WLD"), as by definition exporters in exvadir objects are the countries of origin of value added. \ To include a vector with several exporters (e.g., c("ESP", "FRA")) the exvadec object must have been created with the option exporter = "all" in the command make_exvadec(). get_data() will then produce matrices horizontally bound.

sector

A character vector with sector codes, e.g. TOTAL, AGF, MANUF, c("TOTAL", "AGF", "MANUF", "SERVS"). Available codes can be checked with info_sec().

importer

String vector with importing country or country group codes, e.g. "WLD", "ESP", "EU27", c("WLD", "EU27", "NONEU27"). Available codes can be checked with info_geo().\ Please note that country groups will not show the strict values of "DVA", "VAX" etc. but an average value of the countries included in that group. To obtain the specific "DVA", "VAX", etc. for a group, an exvadec object must be specifically created for that country group.\ Of course, variables that do not require to exclude double-counting, like "EXGR", "DC" or"FC" will be the same in both cases, so no specific exvadec object will be required.

demand_comp

A character vector of demand components, e.g., "HFCE", c("HFCE", "GCFC"). Only valid for wio objects.

custom

Boolean specifying whether custom-made groups of countries or sectors are present in the environment to be used. For instance, a custom HITECH custom variable including high-tech sectors or a LDC variable with list of least-developed countries. Note that custom variables should be referred to as strings in get_data(), i.e. as "HITECH" and "LDC".

Value

A two-dimensional matrix with sector and geographical data of a variable.

Examples

wio <- make_wio("wiodtest")
get_data(wio, "EXGR", exp = "ESP", sec = "MANUF")
get_data(wio, "EXGR", exp = "ESP", sec = c("TOTAL", "MANUF", "SRVWC"),
         imp = c("USA", "FRA"))

exvatools documentation built on May 29, 2024, 6:46 a.m.