Learn R Programming

fio (version 0.1.6)

import_element: Import IOM data

Description

Import data from a input-output matrix (IOM) from Excel format.

Usage

import_element(file, sheet, range, col_names = FALSE, row_names = FALSE)

Value

A (matrix).

Arguments

file

Path to the Excel file.

sheet

Name of the sheet in the Excel file.

range

Range of cells in the Excel file.

col_names

Range of cells with column names.

row_names

Range of cells with row names.

Examples

Run this code
# Excel file with IOM data
path_to_xlsx <- system.file("extdata", "iom/br/2020.xlsx", package = "fio")
# Import IOM data
intermediate_transactions = import_element(
  file = path_to_xlsx,
  sheet = "iom",
  range = "D6:BB56",
  col_names = "D4:BB4",
  row_names = "B6:B56"
)
# Show the first 6 rows and 6 columns
intermediate_transactions[1:6, 1:6]

Run the code above in your browser using DataLab