Learn R Programming

⚠️There's a newer version (0.9.3) of this package.Take me there.

iotables

The symmetric input-output tables (SIOTs) are complex statistical products that present inter-related statistics in a predefined structure. They are often found in spreadsheets that follow this structure, or in the case Eurostat in a data repository. In both cases they in reproducible research must be downloaded and restructured to programmatically accessible form. Often these highly structured statistics need to be analyzed together with other data, for example, when employment effects and multipliers are calculated. In this case processing the employment data to SIOT conforming format is a significant preprocessing challenge.

The iotables are exactly designed for these tasks. Currently the package downloads and processes standardized European SIOTs conforming to the latest statistical regulations, i.e. SIOTs starting from the year 2010.

The aim of this introduction is not to introduce input-output economics, or SIOTs in detail. The Eurostat Manual of Supply, Use and Input-Output Tables and the Eurostat thematic page (for further reference: Eurostat Manual) in the documentation should be consulted for further information about the data and the metadata.

In order to test the analytical functions of the package and to have a manageable sized example data set, we use the real-life data from the Eurostat manual. The germany_1990 dataset is a simplified 6x6 sized SIOT taken from the Eurostat Manual (p481). The package function examples can be checked against published results from Jörg Beutel. These calculations can be followed in the Germany 1990 vignette.

The calculation of induced effects (Type-II multipliers) are following the Input-Output Multipliers Specification Sheet and Supporting Material, Spicosa Project Report. The analytical functions are tested against this example, too.

Installation

You can install iotables 0.4.6 from CRAN or the latest 0.4.7 development version with github:

# From CRAN:
install.packages("iotables")

# From Github (development version)
devtools::install_github("rOpenGov/iotables")

#with vignettes:
#devtools::install_github("rOpenGov/iotables", build_vignettes = TRUE)

You can download the manual in PDF for the 0.4.7 development release. and follow the changes on the Changelog/NEWS.

Vignettes

The Introduction to iotables vignette presents most of the examples of the Eurostat Manual of Supply, Use and Input-Output Tables (Eurostat Manual, Chapter 15.) This is a good introduction to understand what will the functions do, and to check that they work correctly. The testthat infrastructure of the package checks the proper working of the functions against the published results from the Eurostat Manual.

The Working with Eurostat Data vignette shows how you can download, pre-process and use real data from Eurostat.

The United Kingdom Input-Output Analytical Tables 2010 are used for testing the iotables package, because they are well-documented and detailed, organized data is available with them. These calculations can be followed in the United Kingdom Input-Output Analytical Tables vignette.

Acquiring data

Eurostat’s data can be downloaded in several tidy, long-form, files, and a lot of filtering is needed to start working with it.

Currently the following Eurostat SIOTs can be used:

Table typesource code
product x product SIOTsnaio_10_cp1700 or naio_10_pyp1700
industry x industry SIOTsnaio_10_cp1750 ornaio_10_pyp1750
use tables at basic pricesnaio_10_cp1620 or naio_10_pyp1610
trade and transport marginsnaio_10_cp1620 or naio_10_pyp1620
net taxes less subsidiesnaio_10_cp1630 or naio_10_pyp1630
Supply table at basic pricesnaio_10_cp15
Use table at purchasers’ pricenaio_10_cp16

The cp element refers to basic prices and the pyp to previous years’ prices.

Contribute

Contributions are very welcome:

Acknowledgements

Kindly cite this work as follows:

Daniel Antal. (2020, December 21). rOpenGov/iotables: Importing and Manipulating Symmetric Input-Output Tables (Version 0.4.7). Zenodo. https://doi.org/10.5281/zenodo.5795251 for released version. Development version URL: https://ropengov.github.io/iotables/

Thanks to @KKulma for setting up new and improved continuous integration, and @pitkant for implementing many good practices on improving the code. See contributors. This project is part of rOpenGov.

Code of Conduct

Please note that the iotables project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('iotables')

Monthly Downloads

348

Version

0.4.7

License

MIT + file LICENSE

Maintainer

Daniel Antal

Last Published

December 22nd, 2021

Functions in iotables (0.4.7)

check_digits

Check digits parameter This is an internal function to determine if the rounding can go ahead.
conforming_vector_create

Create an empty conforming vector
coefficient_matrix_create

Create a coefficient matrix
croatia_2010_1800

Input-output table for Croatia, 2010.
croatia_2010_1700

Input-output table for Croatia, 2010.
empty_remove

Symmetrically remove empty rows and columns
forward_linkages

Forward linkages
iotable_year_get

Get Available Years For Input-Output Tables
iotables

iotables
germany_1990

Simple input-output table for Germany, 1990.
iotables_metadata_get

Get Metadata from Nested iotables File
iotables_download

Download input-output tables
create_knitr_table

Create an output-independent, well formatted kable table
is_key_column_present

Is a keyword present in a key column?
input_multipliers_create

Create input multipliers The function creates the multipliers (direct + indirect effects).
employment_get

Get employment data
employment_metadata

Employment metadata
indirect_effects_create

Create indirect effects
household_column_get

Return Final Household Expenditure
household_column_find

Return the position of final household expenditure
is_latex_output

Check if Latex output is required
iotable_get

Get an input-output table fom bulk file
iotables_read_tempdir

Read input-output tables from temporary directory Validate the source input parameter and try to load the table from the current sessions' temporary directory.
  • naio_10_cp1700Symmetric input-output table at basic prices (product by product)

  • naio_10_pyp1700Symmetric input-output table at basic prices (product by product) (previous years prices)

  • naio_10_cp1750Symmetric input-output table at basic prices (industry by industry)

  • naio_10_pyp1750Symmetric input-output table at basic prices (industry by industry) (previous years prices)

  • naio_10_cp15Supply table at basic prices incl. transformation into purchasers' prices

  • naio_10_cp16Use table at purchasers' prices

  • naio_10_cp1610Use table at basic prices

  • naio_10_pyp1610Use table at basic prices (previous years prices) (naio_10_pyp1610)

  • naio_10_cp1620Table of trade and transport margins at basic prices

  • naio_10_pyp1620Table of trade and transport margins at previous years' prices

  • naio_10_cp1630Table of taxes less subsidies on products at basic prices

  • naio_10_pyp1630Table of taxes less subsidies on products at previous years' prices

  • uk_2010_siotUnited Kingdom Input-Output Analytical Tables data

croatia_employment_aggregation

Aggregation table for Croatian employment statistics
output_coefficient_matrix_create

Create an output coefficient matrix
uk_2010_get

Get United Kingdom Input-Output Analytical Tables, 2010
equation_solve

Solve a basic (matrix) equation
output_get

Get an output vector
uk_2010_results_get

Get United Kingdom Multipliers and Effects, 2010
input_coefficient_matrix_create

Create an input coefficient matrix
netherlands_2006

Simple input-output table for the Netherlands, 2006.
leontieff_inverse_create

Create the inverse of a Leontieff-matrix.
metadata_uk_2010

Multipliers and effects (product) for testing from the United Kingdom Input-Output Analytical Tables, 2010
input_flow_get

Create a use (input flow) matrix
direct_effects_create

Create direct effects
multiplier_create

Create multipliers
input_indicator_create

Create input indicator(s)
leontieff_matrix_create

Create a Leontieff matrix
non_zero_columns_find

Find Non-zero Columns
matrix_round

Round all matrix values to required number of digits.
output_multiplier_create

Create output multipliers
primary_input_get

Get primary inputs This function will retrieve any primary input from the input-output table.
%>%

Pipe operator
is_html_output

Check if HTML output is required
tempdir_data

Download to and retrieve from the temporary directory a Eurostat dataset
supplementary_add

Add Supplementary Data
metadata

Metadata
quadrant_separator_find

Determine the end of Quadrant I and III.
validate_source

Validate source Parameter
uk_test_results

Multipliers and effects (product) for testing from the United Kingdom Input-Output Analytical Tables, 2010
primary_inputs

Primary input abbreviations
total_tax_add

Summarize and add tax data
uk_2010_data

United Kingdom Input-Output Analytical Tables, 2010
vector_transpose

Transpose a vector
round_table

Systematically round values in a table
airpol_get

Get air pollutant data
backward_linkages

Backward linkages
croatia_2010_1900

Input-output table for Croatia, 2010.
croatia_employment_2013

Croatian employment data for the year 2013