get_var_structure {HARplus} | R Documentation |
Get Variable Structure Summary from SL4 and HAR Objects
Description
Generates a summary of the variables within one or more SL4 or HAR objects, listing their dimension sizes, structures, and optionally, column and observation counts.
Usage
get_var_structure(variables = NULL, ..., include_col_size = FALSE)
Arguments
variables |
Character vector. Variable names to summarize. Use |
... |
One or more SL4 or HAR objects created using |
include_col_size |
Logical. If |
Details
Extracts dimension structures for variables in one or more SL4 or HAR datasets.
If
include_col_size = TRUE
, adds column and observation counts.Supports multiple datasets and returns results as a named list, with each dataset’s summary stored separately.
Can summarize specific variables or
"ALL"
.
Value
A named list, where each element contains a data frame with:
-
Variable
: The variable name. -
Dimensions
: The associated dimensions. -
DimSize
: The number of dimensions. -
DataShape
: The shape of the data (e.g.,10x20x30
). -
No.Col
: (Optional) The number of columns. -
No.Obs
: (Optional) The number of observations.
Author(s)
Pattawee Puangchit
See Also
get_dim_patterns
, get_dim_elements
Examples
# Import data sample:
sl4_data <- load_sl4x(system.file("extdata", "TAR10.sl4", package = "HARplus"))
sl4_data1 <- load_sl4x(system.file("extdata", "SUBT10.sl4", package = "HARplus"))
# Get summary for all variables in a single dataset
get_var_structure(data_obj = sl4_data)
# Get summary for specific variables
get_var_structure(c("gdp", "trade"), sl4_data)
# Include column and observation counts
get_var_structure("ALL", sl4_data, include_col_size = TRUE)
# Compare structures across multiple datasets
get_var_structure("ALL", sl4_data, sl4_data1)
# Include column and observation counts across multiple datasets
get_var_structure("ALL", sl4_data, sl4_data1, include_col_size = TRUE)