Skip to contents

Bundle links

Usage

pipe_bundle_links(graf, field = NULL, group = field)

Arguments

graf

A mapfile representing a causal map. A mapfile is a tidygraph, which consists of a table of edges linked to a table of nodes, with an optional additional table of statements. In this package, nodes are called `factors` and edges are called `links.`

field

Value

A mapfile in which sets of coterminal, same-direction links are replaced with one link (when `field` = 'n') or more than one link for each of the values of `field` present in the data. In each case, each new link has a field n representing the number of links it is replacing, unless the links it is replacing already had values n in which case the new value of `n` is the sum of the `n` values of the constituent links.

Examples

# Showing separate (bundled) links for women and men:
if(F)cashTransferMap %>% pipe_merge_statements() %>%  pipe_select_factors(10) %>% pipe_bundle_links(counter="frequency",group="1. Sex")%>% pipe_label_links(field = "frequency") %>% pipe_color_links(field="1. Sex") %>% pipe_scale_links() %>%  make_print_map()
# or, counting sources rather than statements:
if(F)cashTransferMap %>% pipe_merge_statements() %>%  pipe_select_factors(10) %>% pipe_bundle_links(group="1. Sex",counter="#SourceID")%>% pipe_label_links(field = "frequency") %>% pipe_color_links(field="1. Sex") %>% pipe_scale_links() %>%  make_print_map()