network.extensions | R Documentation |
Various core functions from the network package, with specialized extensions for handling dynamic data.
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,...)
x |
an object of class |
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 |
an optional end time for the selection interval. This must be accompanied by one of |
length |
the length of the selection interval. This must be accompanied by one of |
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 |
type |
a text string that functions as |
rule |
a text string for defining “active” for this call: |
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 |
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.
The return value matches that of the original function, suitably filtered.
The current temporal implementation of these routines will be slower compared to the non-temporal versions. Do not use them unless you have to.
Carter T. Butts buttsc@uci.edu
Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). https://www.jstatsoft.org/v24/i02/
network.extract
, is.active
, get.edgeIDs
, get.edges
, get.neighborhood
, is.adjacent
, network.dyadcount
, network.edgecount
, network.naedgecount
, network.size
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.