.spl_context in analysis and split functions
spl_context within analysis and split functions
.spl_context in analysis and split functions
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 slighlyt different form. Each split (which correspond to groups of rows in the resulting table) is
represented via the following columns:
The name of the split (often the variable being split in the simple case)
The string representation of the value at that split
a dataframe containing the full data (ie across all columns) corresponding to the path
defined by the combination of split and value of this row and all rows above this row
the number of observations corresponding to this row grouping (union of all columns)
These
list columns (named the same as names(col_exprs(tab))) contain logical vectors corresponding to the
subset of this row's full_parent_df corresponding to that column
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
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