Extracts and arranges the aggregated values for use in causal network plots.
extract_vals_causal.Rd
This takes the aggregations at each stage along the theme axis, extracts the aggregated values for a given aggregation history (ie the sequence of aggregation functions), and returns in a form that can be added to edges or nodes dfs.
Usage
extract_vals_causal(agglist, whichaggs, valcol, targetlevels = names(agglist))
Arguments
- agglist
a list of tibbles of each step in the theme aggregation (output of
theme_agg_multi
withsaveintermediate = TRUE
). Currently assumes the aggregation history is already in columns (eithertheme_agg_multi
withnamehistory = FALSE
or have runagg_names_to_cols
). Would be fairly easy to detect and add a call toagg_names_to_cols
if this becomes an issue.- whichaggs
a character vector or list with one string per list item of the desired sequence of aggregation functions. This has to have only values used in the aggregation used to create
agglist
, and can have only one entry per step (unlike in the creation ofagglist
). If different aggregation histories are required, this should be run again, because it is not appropriate to mix histories in a causal plot.- valcol
character, name of the column with the aggregated values.
- targetlevels
character, names of levels to include. Defaults to
names(agglist)
. Any subset of those names can be used.