Extracts exporting country and sector and destination data from a specific
variable in an exvatools
object.
get_data(
exvatools_object,
var,
exporter,
sector = "TOTAL",
importer = "WLD",
demand_comp = "TOTAL",
custom = FALSE
)
A two-dimensional matrix with sector and geographical data of a variable.
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).
String for the selected variable included in the exvatools
object: "VA"
, "X"
, "EXGR"
, "VAX"
,
"DC"
, "DVA"
, etc.
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.
A character vector with sector codes, e.g. TOTAL
,
AGF
, MANUF
, c("TOTAL", "AGF", "MANUF", "SERVS")
.
Available codes can be checked with info_sec()
.
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.
A character vector of demand components, e.g.,
"HFCE"
, c("HFCE", "GCFC")
. Only valid for wio
objects.
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"
.
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"))
Run the code above in your browser using DataLab