powered by
Sets a vertex attribute on an object of class network. This function simplifies the related function in the network package.
network
set_vertex_attribute(x, attrname, value, v)
Returns an object of class network.
An object of class network.
The name of the attribute to set.
A vector of values of the attribute to be set.
IDs for the vertices whose attributes are to be altered.
This function is used in EpiModel workflows to set 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)) nw
Run the code above in your browser using DataLab