.spl_context within analysis and split functions
.spl_context Details
The .spl_context
data.frame
gives information about the subsets of data
corresponding to the splits within-which the current analyze
action is
nested. Taken together, these correspond to the path that the resulting (set
of) rows the analysis function is creating, although the information is in a
slightly different form. Each split (which correspond to groups of rows in
the resulting table), as well as the initial 'root' "split", is represented
via the following columns:
- split
The name of the split (often the variable being split in the simple case)
- value
The string representation of the value at that split
- full_parent_df
a dataframe containing the full data (ie across all columns) corresponding to the path defined by the combination of
split
andvalue
of this row and all rows above this row- all_cols_n
the number of observations corresponding to this row grouping (union of all columns)
- (row-split and analyze contexts only) <1 column for each column in the table structure
These list columns (named the same as
names(col_exprs(tab))
) contain logical vectors corresponding to the subset of this row'sfull_parent_df
corresponding to that column- cur_col_subset
List column containing logical vectors indicating the subset of that row's
full_parent_df
for the column currently being created by the analysis function- cur_col_n
integer column containing the observation counts for that split
note Within analysis functions that accept .spl_context
, the
all_cols_n
and cur_col_n
columns of the dataframe will contain the 'true'
observation counts corresponding to the row-group and row-group x column
subsets of the data. These numbers will not, and currently cannot, reflect
alternate column observation counts provided by the alt_counts_df
,
col_counts
or col_total
arguments to build_table