Learn R Programming

popgraph (version 1.4)

decorate_graph: Merge data into popgraph node-wise

Description

This function takes a data frame and a popgraph object and attempts to add the node data (from the data frame) to the graph as vertex attributes.

Usage

decorate_graph(graph, data, stratum = "Population")

Arguments

graph
An object of type igraph to populate
data
An object of type data.frame that has a Node column that is the same as the V(graph)$name values.
stratum
The column name of node lables to match up with graph.stratum (default 'Population') to be matched with V(graph)$name attribute

Value

A populated igraph object with as much of the metadata in the data.frame as possible stitched into the igraph object