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

network.extensions

Dynamically Extended Core Network Functions


Description

Various core functions from the network package, with specialized extensions for handling dynamic data.

Usage

get.edgeIDs.active(x, v, onset = NULL, terminus = NULL, length = NULL, at = NULL,
    alter = NULL, neighborhood = c("out", "in", "combined"), 
    rule = c("any", "all", "earliest", "latest"), na.omit = TRUE, active.default = TRUE)
get.edges.active(x, v, onset = NULL, terminus = NULL, length = NULL, at = NULL,
    alter = NULL, neighborhood = c("out", "in", "combined"), 
    rule = c("any", "all", "earliest", "latest"), na.omit = TRUE, active.default = TRUE)
get.neighborhood.active(x, v, onset = NULL, terminus = NULL, length = NULL, at = NULL,
    type = c("out", "in", "combined"), rule = c("any", "all", "earliest", "latest"), 
    na.omit = TRUE, active.default = TRUE)

is.adjacent.active(x, vi, vj, onset = NULL, terminus = NULL, length = NULL, at = NULL, 
    rule = c("any", "all", "earliest", "latest"), na.omit = FALSE, active.default = TRUE)

## S3 method for class 'active'
network.dyadcount(x, onset = NULL, terminus = NULL, length = NULL, at = NULL, 
    rule = c("any", "all", "earliest", "latest"),
    na.omit = TRUE, active.default = TRUE,...)
## S3 method for class 'active'
network.edgecount(x, onset = NULL, terminus = NULL, length = NULL, at = NULL,
    rule = c("any", "all", "earliest", "latest"),
    na.omit = TRUE, active.default = TRUE,...)
## S3 method for class 'active'
network.naedgecount(x, onset = NULL, terminus = NULL, length = NULL, at = NULL, 
    rule = c("any", "all", "earliest", "latest"),
    active.default = TRUE,...)
## S3 method for class 'active'
network.size(x, onset = NULL, terminus = NULL, length = NULL, at = NULL, 
    rule = c("any", "all", "earliest", "latest"),
    active.default = TRUE,...)

Arguments

x

an object of class network

v

a required vertex ID.

vi

an optional vertex ID (tail).

vj

an optional vertex ID (head).

onset

an optional start time for the selection interval. This must be accompanied by one of terminus or length.

terminus

an optional end time for the selection interval. This must be accompanied by one of onset or length.

length

the length of the selection interval. This must be accompanied by one of onset or terminus

at

a time point for selecting edges/vertices.

alter

optionally, the ID of another vertex.

neighborhood

a text string that indicates whether we are interested in in-edges, out-edges, or both (relative to v).

type

a text string that functions as neighborhood, above, for vertex neighborhoods.

rule

a text string for defining “active” for this call: any (default) to select elements appearing at any time during the specified interval, or all to select only elements active for the entire interval. For these functions, the values of earliest and latest are equivalent to any and are only included for consistency.

na.omit

logical; should we omit missing edges?

active.default

logical; should elements without an activity attribute be regarded as active by default?

...

possible additional argumenets

Details

These functions are “dynamically extended” versions of their standard network counterparts. As such, conventional aspects of their behavior can be found on their respective manual pages (see below). In all cases, the sole difference between the extended and non-extended versions lies in the ability of the user to specify a time point (or interval), such that only vertices and edges active at the indicated time (or during the indicated interval) are employed by the routine.

For elements (edges and vertices) lacking an activity attribute, the active.default argument determines appropriate treatment. By default, all such elements are considered active.

Value

The return value matches that of the original function, suitably filtered.

Note

The current temporal implementation of these routines will be slower compared to the non-temporal versions. Do not use them unless you have to.

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

Examples

## is.adjacent.active
triangle <- network.initialize(3)    # create a toy network
add.edge(triangle,1,2)               # add an edge between vertices 1 and 2
add.edge(triangle,2,3)               # add a more edges
add.edge(triangle,3,1)
is.adjacent.active(triangle,vi=1,vj=2,onset=2,length=1)

## get.edges.active
net <-network.initialize(5)
net[1,2]<-1;
net[2,3]<-1;
activate.edges(net,onset=1,terminus=Inf,e=1)
activate.edges(net,onset=2,terminus=3,e=2)
get.edges.active(net,v=2,at=1)
get.edges.active(net,v=2,at=1, neighborhood="combined")
get.edges.active(net,v=2,at=2, neighborhood="combined")

## get the ids of the active edges instead (could be multiple incident edges)
get.edgeIDs.active(net,v=2,at=2)

## or get ids of the active nodes in a vertex neighborhood
get.neighborhood.active(net,v=2,at=2)

# returns both edges
get.edges.active(net,v=2,onset=1, terminus=3, neighborhood="combined", rule='any')
# returns only one edge (e=2)
get.edges.active(net,v=2,onset=1, terminus=3, neighborhood="combined", rule='all')

## network.edgecount.active
network.edgecount.active(net, at=1, active.default=FALSE)
network.edgecount.active(net, at=2, active.default=FALSE)
network.edgecount.active(net, at=5, active.default=FALSE)

networkDynamic

Dynamic Extensions for Network Objects

v0.10.1
GPL-3
Authors
Carter T. Butts [aut], Ayn Leslie-Cook [aut], Pavel N. Krivitsky [aut], Skye Bender-deMoll [aut, cre], Zack Almquist [ctb], David R. Hunter [ctb], Li Wang [ctb], Kirk Li [ctb], Steven M. Goodreau [ctb], Jeffrey Horner [ctb], Martina Morris [ctb]
Initial release
2020-01-16

We don't support your browser anymore

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