io_load_icio: Download IO tables from the OECD ICIO

View source: R/io_load_icio.R

io_load_icioR Documentation

Download IO tables from the OECD ICIO

Description

Function to download the set of inter country input output (icio) tables made available by the OECD's 2021 release.

Usage

io_load_icio(
  cache_dir = NULL,
  years = 1995:2018,
  components = c("Rdata", "Z"),
  quiet = FALSE
)

Arguments

cache_dir

path to cache the ICIO data. If the full content of the ICIO data zip file is found under this location it will not be downloaded again.

years

which year(s) to load. Must be a single value or vector of values between 1995 and 2018. Can be used to reduce memory needs and speed up loading.

components

a character vector with one or several components of the ICIO tables to load. Options are "Rdata" which load all components from ICIO's 'Rdata' set, "Z" which loads the intermediate matrix Z, as well as "A", "B", and "VB" for the respective supplementary matrices. Additionally, accepted options are the individual parts of the 'Rdata' set ("CONS", "CVB", "FD", "GFCF", "GGFC", "GTR", "GTR_FNL", "GTR_INT", "HFCE", "INVNT", "NONRES", "NPISH", "VA", "VAexTAX", "X"). However, since all components from ICIO's 'Rdata' set are only available for download in a joint zip file. Selecting one of these components will download the entire set and place it in cache_dir, but only load the selected parts into R. See OECD's ICIO web page for details on these components.

quiet

if TRUE will try to avoid printing messages

Value

Returns one data.frame combining all years and requested components from the ICIOs from the OECD's 2021 release.

References

OECD (2021), OECD Inter-Country Input-Output Database, http://oe.cd/icio

Examples

## Not run: 

library(iotr)

# set cache_dir for ICIO to avoid (very) long download times on every run !!!
cache_dir <- NULL

icio_raw <- io_load_icio(cache_dir,
                         years = 2010:2012,
                         components = c("Z", "CONS", "GFCF", "INVNT", "NONRES"))

icio <- io_tidy_icio(icio_raw)

## End(Not run)

okrebs/iotr documentation built on Aug. 22, 2023, 12:06 p.m.