add.vertices {network}R Documentation

Add Vertices to an Existing Network

Description

add.vertices adds a specified number of vertices to an existing network; if desired, attributes for the new vertices may be specified as well.

Usage

add.vertices(x, nv, vattr = NULL)

Arguments

x an object of class network
nv the number of vertices to add
vattr optionally, a list of attributes with one entry per new vertex

Details

Note that the attribute format used here is based on the internal (vertex-wise) storage method, as opposed to the attribute-wise format used by network.

Value

Invisibly, a pointer to the updated network object; add.vertices modifies its argument in place.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). http://www.jstatsoft.org/v24/i02/

See Also

network, get.vertex.attribute, set.vertex.attribute

Examples

#Initialize a network object
g<-network.initialize(5)
g

#Add five more vertices
add.vertices(g,5)
g

[Package network version 1.4-1 Index]