Convert a connected_components data.frame into a vertex map for visualizing the results.

components_to_map(graph, components, type = c("size", "label"))

Arguments

graph

the parent igraph generated by obj_to_graph and used with connected_components

components

the data.frame results of connected_components

type

whether to return the size of the component or its label

Value

A vector corresponding to each vertex in graph with either zero, or the size/label from the connected components calculation