Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

valid.eids

Get the ids of all the edges that are valid in a network


Description

Returns a vector of valid edge ids (corresponding to non-NULL edges) for a network that may have some deleted edges.

Usage

valid.eids(x)

Arguments

x

a network object, possibly with some deleted edges.

Details

The edge ids used in the network package are positional indices on the internal "mel" list. When edges are removed using delete.edges NULL elements are left on the list. The function valid.eids returns the ids of all the valid (non-null) edge ids for its network argument.

Value

a vector of integer ids corresponding to the non-null edges in x

Note

If it is known that x has no deleted edges, seq_along(x$mel) is a faster way to generate the sequence of possible edge ids.

Author(s)

skyebend

See Also

See also delete.edges

Examples

net<-network.initialize(100)
add.edges(net,1:99,2:100)
delete.edges(net,eid=5:95)
# get the ids of the non-deleted edges
valid.eids(net)

network

Classes for Relational Data

v1.16.1
GPL (>= 2)
Authors
Carter T. Butts [aut, cre], David Hunter [ctb], Mark Handcock [ctb], Skye Bender-deMoll [ctb], Jeffrey Horner [ctb], Li Wang [ctb]
Initial release
2020-10-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.