node2edgeAttr: Assigns edge attributes to network based on node attributes

Description Usage Arguments Author(s) Examples

Description

Description: The function node2edgeAttr assigns edge attributes to a network object based on the node attribute specified in the argument.

Usage

1
node2edgeAttr(net.object, vertex.attribute)

Arguments

net.object

The network object. Accepts both igraph and network objects

net.samples

Node or vertex.attribute to be used to create the edge attribute.

directed

Defaults to FALSE. Indicates whether the network is directed or not. If undirected the function aggregates edges nodeA->nodeB and nodeB->nodeA as the same .

Author(s)

Marco T. Bastos

Examples

1
2
3
4
# Not run:
net.object <- barabasi.game(50)
V(net.object)$color <- ifelse(V(net.object) 
E(net.object)$color <- node2edgeAttr(net.object, vertex.attribute = "color") # create edge attribute based on node attribute

toledobastos/iterateNetwork documentation built on May 31, 2019, 5:14 p.m.