load_harx | R Documentation |
Reads a GEMPACK HAR file and extracts structured data while maintaining compatibility with standard HAR formats. Provides flexibility in naming conventions and header selection.
load_harx(
file_path,
coefAsname = FALSE,
lowercase = FALSE,
select_header = NULL
)
file_path |
Character. The file path to the HAR file. |
coefAsname |
Logical. If |
lowercase |
Logical. If |
select_header |
Character vector. Specific headers to read; if |
Uses load_harplus()
internally for efficient HAR file reading.
Allows optional conversion of variable names to lowercase (lowercase = TRUE
).
Supports coefficient-based naming (coefAsname = TRUE
).
Enables selective header extraction via select_header = c("A", "E1")
.
Returns structured data with explicit dimension names and sizes.
A structured list containing:
data
: Extracted HAR variable data stored as matrices, arrays, or vectors.
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_sl4x
, get_data_by_var
, get_data_by_dims
# Path to example files
har_path <- system.file("extdata", "TAR10-WEL.har", package = "HARplus")
# Basic loading
har_data <- load_harx(har_path)
# Load with coefficient names
har_data_coef <- load_harx(har_path, coefAsname = TRUE)
# Load with lowercase names
har_data_lower <- load_harx(har_path, lowercase = TRUE)
# Load specific headers
har_selected <- load_harx(har_path, select_header = c("A", "E1"))
# Load with multiple options
har_combined <- load_harx(har_path,
coefAsname = TRUE,
lowercase = TRUE,
select_header = c("A", "E1"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.