Skip to contents

Download standard input–output (IO) and related tables. At the moment, only Eurostat products are supported. You usually do not need to call this directly; iotable_get() will invoke it as needed and return a filtered, tidy table.

Usage

iotables_download(
  source = "naio_10_cp1700",
  data_directory = NULL,
  force_download = FALSE
)

Arguments

source

Character. The Eurostat product code (see above) or "uk_2010".

data_directory

Optional directory path where the processed nested tables will be saved as "<source>_processed.rds". If NULL (default), results are saved to tempdir().

force_download

Logical. If FALSE (default), reuse a cached file in data_directory or tempdir() when available. If TRUE, force a fresh download from Eurostat.

Value

A nested data.frame (one row per IO table) with metadata columns (geo, unit, year, stk_flow, etc.) and a list-column data containing the tidy table for each combination.

Details

Files are cached under tempdir() as RDS (e.g., "naio_10_cp1750.rds"). The temporary directory is cleared when the R session ends. To persist downloads across sessions (recommended for analytics), supply data_directory and the processed, nested output will also be written there as "<source>_processed.rds".

Supported Eurostat products include (non-exhaustive):

  • naio_10_cp1700 — Symmetric IO table, basic prices (product × product)

  • naio_10_pyp1700 — Same, previous years’ prices

  • naio_10_cp1750 — Symmetric IO table, basic prices (industry × industry)

  • naio_10_pyp1750 — Same, previous years’ prices

  • naio_10_cp15 — Supply table at basic prices incl. margins/taxes

  • naio_10_cp16 — Use table at purchasers’ prices

  • naio_10_cp1610 — Use table at basic prices

  • naio_10_pyp1610 — Use table at basic prices (previous years’ prices)

  • naio_10_cp1620 — Trade and transport margins at basic prices

  • naio_10_pyp1620 — Trade and transport margins at previous years’ prices

  • naio_10_cp1630 — Taxes less subsidies on products at basic prices

  • naio_10_pyp1630 — Taxes less subsidies on products, prev. years’ prices

  • uk_2010 — United Kingdom IO Analytical Tables (handled internally)

Eurostat API/format changes (e.g., TIME_PERIOD vs time) are handled for backward compatibility.

See also

Examples

# \donttest{
io_tables <- iotables_download(source = "naio_10_pyp1750")
#> Table naio_10_pyp1750 cached at C:\Users\DANIEL~1\AppData\Local\Temp\RtmpSeC1Nd/eurostat/d7fe4dbf5ff51114a5dde14ae27de3d2.rds
#> Saving 114 input-output tables into the temporary directory.
#> Saved the raw data of this table type in temporary directory C:\Users\DANIEL~1\AppData\Local\Temp\RtmpSeC1Nd/naio_10_pyp1750_processed.rds.
# }