Learn R Programming

EpiModel (version 2.5.0)

get_vertex_attribute: Get Vertex Attribute on Network Object

Description

Gets a vertex attribute from an object of class network. This functions simplifies the related function in the network package.

Usage

get_vertex_attribute(x, attrname)

Value

Returns an object of class network.

Arguments

x

An object of class network.

attrname

The name of the attribute to get.

Details

This function is used in EpiModel workflows to query vertex attributes on an initialized empty network object (see network_initialize).

Examples

Run this code
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