Learn R Programming

iotables (version 0.9.4)

iotable_get: Get a single input–output table from bulk data

Description

Filter and reshape one IO/SUT table from a bulk dataset (typically a Eurostat download). In most workflows you will call this function rather than iotables_download(), which it invokes as needed.

Usage

iotable_get(
  labelled_io_data = NULL,
  source = "germany_1995",
  geo = "DE",
  year = 1990,
  unit = "MIO_EUR",
  stk_flow = "DOM",
  labelling = "iotables",
  data_directory = NULL,
  force_download = TRUE
)

Value

A wide

data.frame representing the selected IO table, with a key column followed by ordered numeric columns.

Arguments

labelled_io_data

Optional nested bulk data as returned by iotables_download(). If NULL (default), data are retrieved from cache or downloaded.

source

Data source code (see list above).

geo

Country code or name, e.g. "SK" or "Slovakia".

year

Numeric year. Defaults to 1990 for germany_1995.

unit

Currency unit, usually "MIO_NAC" or "MIO_EUR".

stk_flow

Stock/flow: "DOM", "IMP", or "TOTAL". For margins/taxes (cp1620, cp1630 and pyp variants) only "TOTAL" is used; other inputs are coerced with a warning.

labelling

Column naming scheme: "iotables" (default) for consistent names; "short" for original short codes; "eurostat" is treated as "short".

data_directory

Optional directory to save the processed wide table (RDS). If NULL, nothing is saved.

force_download

Logical. If TRUE, force a fresh download when labelled_io_data is not supplied. Defaults to TRUE.

Details

The Eurostat bulk tables arrive in long form and are not ordered for matrix algebra. This function selects the requested country (geo), year, unit and stock/flow (stk_flow), joins iotables metadata for consistent row/column labelling, and returns a wide table ready for analysis.

Supported sources include:

  • naio_10_cp1700 — symmetric IO, basic prices (prod × prod)

  • naio_10_pyp1700 — previous years' prices

  • naio_10_cp1750 — symmetric IO, basic prices (ind × ind)

  • naio_10_pyp1750 — previous years' prices

  • naio_10_cp15 — supply at basic prices incl. margins/taxes

  • naio_10_cp16 — use at purchasers' prices

  • naio_10_cp1610 — use at basic prices

  • naio_10_cp1620 — trade & transport margins (basic prices)

  • naio_10_cp1630 — taxes less subsidies on products (basic prices)

  • naio_10_pyp* — corresponding previous years' prices variants

  • germany_1995 — packaged Beutel example

  • croatia_2010_1700/1800/1900 — packaged examples

  • uk_2010_* — packaged UK 2010 variants

Examples

Run this code
germany_table <- iotable_get(
  source = "germany_1995",
  geo = "DE", year = 1990, unit = "MIO_EUR",
  labelling = "iotables"
)

Run the code above in your browser using DataLab