R/networkGraphs.R
applyCategoricalFilters.Rd
This function removes vertices that are not in the selected categories values list or sub-categories.
applyCategoricalFilters(
g,
selected_cat,
selected_subcats,
cat_prefix = "vosonCA_"
)
igraph graph
object.
Character string. Selected vertex category without prefix.
List. Selected sub-category values to include in graph.
Character string. Category attribute prefix format to match. Default is "vosonCA_"
.
An igraph graph object.
if (FALSE) {
# 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"))
}