powered by
Gets a vertex attribute from an object of class network. This function simplifies the related function in the network package.
network
get_vertex_attribute(x, attrname)
Returns a vector of vertex attribute values for the attribute specified by attrname.
attrname
An object of class network.
The name of the attribute to get.
This function is used in EpiModel workflows to query vertex attributes on an initialized empty network object (see network_initialize()).
EpiModel
network_initialize()
nw <- network_initialize(100) nw <- set_vertex_attribute(nw, "age", runif(100, 15, 65)) get_vertex_attribute(nw, "age")
Run the code above in your browser using DataLab