process_decomp_level {HARplus} | R Documentation |
Process Decomposition Levels in Data Frames (Internal)
Description
A helper function that filters data based on decomposition levels in the "Subtotal"
column.
Used internally in get_data_by_var()
, get_data_by_dims()
, and group_data_by_dims()
.
Usage
process_decomp_level(df, subtotal_level)
Arguments
df |
A data frame containing a |
subtotal_level |
Character or logical. Determines which values to retain:
|
Details
If
subtotal_level = "total"
, keeps only"TOTAL"
values, removing all decomposed components.If
subtotal_level = "decomposed"
, keeps only decomposed components, removing"TOTAL"
.If
subtotal_level = "all"
, keeps both"TOTAL"
and decomposed values (no filtering).If
subtotal_level = TRUE
(logical), it is equivalent to"all"
, meaning all values are kept.If
subtotal_level = FALSE
(logical), it is equivalent to"total"
, meaning only"TOTAL"
values are kept, and decomposed components are removed.Filtering is applied only when both
"TOTAL"
and decomposed values exist.
Value
A filtered data frame based on the specified decomposition level.
Author(s)
Pattawee Puangchit
See Also
get_data_by_var
, get_data_by_dims
, group_data_by_dims