Learn R Programming

iotables (version 0.9.4)

supplementary_add: Add supplementary rows to an IO/SUT table

Description

Append supplementary indicators (e.g., emissions coefficients) as new rows to a symmetric input–output table (SIOT), use, supply, or margins table. This is a light wrapper around rows_add().

Usage

supplementary_add(data_table, supplementary_data, supplementary_names = NULL)

Value

A data.frame with the rows of supplementary_data bound to data_table and aligned to its key and numeric columns.

Arguments

data_table

A SIOT, use, supply, or margins table (key column + numeric columns).

supplementary_data

A data frame (or tibble) of one or more rows to add. It may already contain a key column (first column). Otherwise, provide supplementary_names or the keys will be auto-generated. All other column names must match data_table.

supplementary_names

Optional character vector of row names for the key column; length must equal nrow(supplementary_data). Ignored if a key column is already present.

Details

Column names in supplementary_data must match the numeric columns of data_table. If the key column is missing, it is created from supplementary_names or auto-generated as supplementary_row_#.

When a household final consumption column is present (e.g., final_consumption_households, P3_S14), new rows get 0 in that column if the supplied values are NA.

For terminology, see Eurostat’s Manual of Supply, Use and Input-Output Tables. (Eurostat, 2008; ISBN 978-92-79-04704-3)

See Also

Other iotables processing functions: conforming_vector_create(), empty_remove(), household_column_find(), household_column_get(), iotable_year_get(), key_column_create(), matrix_round(), output_get(), primary_input_get(), rows_add(), total_tax_add(), vector_transpose_longer(), vector_transpose_wider()

Examples

Run this code
de_io <- iotable_get()
CO2_coefficients <- data.frame(
  agriculture_group = 0.2379,
  industry_group = 0.5172,
  construction = 0.0456,
  trade_group = 0.1320,
  business_services_group = 0.0127,
  other_services_group = 0.0530
)
CH4_coefficients <- data.frame(
  agriculture_group = 0.0349,
  industry_group = 0.0011,
  construction = 0,
  trade_group = 0,
  business_services_group = 0,
  other_services_group = 0.0021
)
CO2 <- cbind(
  data.frame(iotables_row = "CO2"),
  CO2_coefficients
)
CH4 <- cbind(
  data.frame(iotables_row = "CH4_coefficients"),
  CH4_coefficients
)
de_coeff <- input_coefficient_matrix_create ( iotable_get() )
emissions <- rbind (CO2, CH4)

# Check with the Eurostat Manual page 494:
supplementary_add(de_io, emissions)

Run the code above in your browser using DataLab