Package 'econioread'

Title: Read Input-Output Tables
Description: Provides a step-by-step interface for reading input-output tables from 'csv', 'xls', and 'xlsx' files into 'econio' input-output table objects. Handles the extraction of headers, regions, sector names, and sector types from raw spreadsheet cells, supporting both regional and multiregional input-output tables.
Authors: Mizuki Uchida [aut, cre]
Maintainer: Mizuki Uchida <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-07-20 08:34:35 UTC
Source: https://github.com/UchidaMizuki/econioread

Help Index


Import cell contents of an input-output table

Description

'io_table_read_cells()' reads the cell contents of an input-output table.

Usage

io_table_read_cells(
  file,
  sheets = NULL,
  rows_range = c(1, Inf),
  rows_exclude = integer(),
  cols_range = c(1, Inf),
  cols_exclude = integer()
)

Arguments

file

Path to the input-output table file.

sheets

A character vector of sheet names to read from. Passed to [tidyxl::xlsx_cells()].

rows_range, cols_range

A numeric vector of length 2 specifying the range of rows and columns to read from.

rows_exclude, cols_exclude

A numeric vector of row and column numbers to exclude.

Value

A data frame containing the cell contents of an input-output table.


Create data of an input-output table

Description

'io_table_read_data()' creates data of an input-output table.

Usage

io_table_read_data(
  cells,
  value_scale,
  value_na = c("", "NA"),
  total_tolerance = .Machine$double.eps^0.5,
  check_axes = TRUE
)

Arguments

cells

A data frame containing the cell contents of an input-output table.

value_scale

A scalar numeric specifying the scale for the numeric values.

value_na

A character vector of strings to be treated as NA values.

total_tolerance

Passed to [econio::io_table_multiregional()] or [econio::io_table_regional()]. By default, '.Machine$double.eps^0.5'.

check_axes

Passed to [econio::io_table_multiregional()] or [econio::io_table_regional()]. By default, 'TRUE'.

Value

An input-output table object.


Create headers of an input-output table

Description

'io_table_read_headers()' creates headers of an input-output table.

Usage

io_table_read_headers(cells, input_names, output_names)

Arguments

cells

A data frame containing the cell contents of an input-output table.

input_names, output_names

A character vector of input and output names.

Value

A data frame containing the headers of an input-output table.


Create columns of regions in an input-output table

Description

'io_table_read_regions()' creates columns of regions in an input-output table.

Usage

io_table_read_regions(cells, input_region_glue, output_region_glue)

Arguments

cells

A data frame containing the cell contents of an input-output table.

input_region_glue, output_region_glue

A scalar character string specifying the glue pattern for input and output regions.

Value

A data frame containing the regions of an input-output table.


Create columns of sector names in an input-output table

Description

'io_table_read_sector_names()' creates columns of sector names in an input-output table.

Usage

io_table_read_sector_names(
  cells,
  input_sector_name_glue,
  output_sector_name_glue
)

Arguments

cells

A data frame containing the cell contents of an input-output table.

input_sector_name_glue, output_sector_name_glue

A scalar character speecifying the glue pattern for input and output sector names.

Value

A data frame containing the sector names of an input-output table.


Create columns of sector types in an input-output table

Description

'io_table_read_sector_types()' creates columns of sector types in an input-output table.

Usage

io_table_read_sector_types(
  cells,
  import_type,
  industry_pattern = NULL,
  industry_total_pattern = NULL,
  import_pattern = NULL,
  import_total_pattern = NULL,
  value_added_pattern = NULL,
  value_added_total_pattern = NULL,
  final_demand_pattern = NULL,
  final_demand_total_pattern = NULL,
  export_pattern = NULL,
  export_total_pattern = NULL,
  total_pattern = NULL
)

Arguments

cells

A data frame containing the cell contents of an input-output table.

import_type

A scalar character, either '"competitive_import"' or '"noncompetitive_import"', indicating the import type of the input-output table.

industry_pattern, import_pattern, value_added_pattern, final_demand_pattern, export_pattern, total_pattern

A scalar character specifying the pattern for sector names.

industry_total_pattern, import_total_pattern, value_added_total_pattern, final_demand_total_pattern, export_total_pattern

A scalar character specifying the pattern for total sector names.

Value

A data frame containing the sector types of an input-output table.


Input-output table reader

Description

'io_table_reader()' provides a step-by-step process to read an input-output table from a file.

Usage

io_table_reader(file, region_type = c("regional", "multiregional"))

Arguments

file

Path to the input-output table file.

region_type

Type of the input-output table. Either '"regional"' or '"multiregional"', by default '"regional"'.

Value

A function that takes a file path and returns a step-by-step input-output table reader.