| load_sl4x | R Documentation |
Reads an SL4 file and processes its structured data into an enhanced SL4 object. Extracts structured variable information, dimensions, and handles subtotal columns.
load_sl4x(file_path, lowercase = FALSE, select_header = NULL)
file_path |
Character. The full path to the SL4 file to be read. |
lowercase |
Logical. If |
select_header |
Character vector. Specific headers to extract; if |
Uses load_harplus() internally for optimized SL4 file reading.
Extracts variable names, dimension structures, and metadata.
Converts variable names to lowercase if lowercase = TRUE.
Allows the selection of specific headers using select_header.
Returns structured data with explicit dimension names and sizes.
A structured list containing:
data: Extracted SL4 variable data, stored as arrays or matrices.
dimension_info: A list with:
dimension_string: A textual representation of dimensions (e.g., "REGCOMMYEAR").
dimension_names: The names of each dimension.
dimension_sizes: The size of each dimension.
Pattawee Puangchit
load_harx, get_data_by_var, get_data_by_dims
# Path to example files
sl4_path <- system.file("extdata", "TAR10.sl4", package = "HARplus")
# Basic loading
sl4_data <- load_sl4x(sl4_path)
# Load with lowercase names
sl4_data_lower <- load_sl4x(sl4_path, lowercase = TRUE)
# Load specific headers
sl4_selected <- load_sl4x(sl4_path, select_header = c("qo", "qgdp"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.