set_vertex_attribute {tergmLite} | R Documentation |
Set Vertex Attribute on Network Object
Description
Set a vertex attribute on an object of class network
,
wrapping the related function in the network
package.
Usage
set_vertex_attribute(x, attrname, value, v)
Arguments
x |
An object of class network. |
attrname |
The name of the attribute to set. |
value |
A vector of values of the attribute to be set. |
v |
IDs for the vertices whose attributes are to be altered. |
Details
This function is used in EpiModel
workflows to set vertex attributes on
an initialized empty network object (with network_initialize
.
Value
Returns an object of class network
.
Examples
## Not run:
nw <- network_initialize(100)
nw <- set_vertex_attribute(nw, "age", runif(100, 15, 65))
nw
## End(Not run)
[Package tergmLite version 2.6.1 Index]