applyCategoricalFilters: Filter out graph vertices not in selected category

Description Usage Arguments Value Examples

View source: R/networkGraphs.R

Description

This function removes vertices that are not in the selected categories values list or sub-categories.

Usage

1
2
3
4
5
6
applyCategoricalFilters(
  g,
  selected_cat,
  selected_subcats,
  cat_prefix = "vosonCA_"
)

Arguments

g

igraph graph object.

selected_cat

Character string. Selected vertex category without prefix.

selected_subcats

List. Selected sub-category values to include in graph.

cat_prefix

Character string. Category attribute prefix format to match. Default is "vosonCA_".

Value

An igraph graph object.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# return a graph containing only vertices that have the vertex category 
# attribute "vosonCA_Stance" value "liberal"
g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml")

g <- applyCategoricalFilters(g, "Stance", c("liberal"))

## End(Not run)

VOSONDash documentation built on July 27, 2020, 5:07 p.m.