get_var_structure | R Documentation |
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.
get_var_structure(variables = NULL, ..., include_col_size = FALSE)
variables |
Character vector. Variable names to summarize. Use |
... |
One or more SL4 or HAR objects created using |
include_col_size |
Logical. If |
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"
.
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.
Pattawee Puangchit
get_dim_patterns
, get_dim_elements
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.