durations: Compute Observed Activity Durations or Event Counts for Edges...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

Computes observed activity durations or event counts for edges or vertices, aggregating at the edges, spell, or dyads level.

Usage

1
2
3
4
5
edgeDuration(nd, mode = c("duration", "counts"), subject = c("edges", "spells", "dyads"),
          e = seq_along(nd$mel), start = NULL, end = NULL, active.default = TRUE)
          
vertexDuration(nd, mode = c("duration", "counts"), subject = c("vertices", "spells"),
     v = seq_len(network.size(nd)), active.default = TRUE)           

Arguments

nd

networkDynamic object to be evaluated

mode

option determining if the 'duration' of the spells should be summed, or simply the 'counts' of the number of spells. The later option is useful when the network contains events of zero duration.

subject

option describing the unit of analysis that the durations or counts should be aggregated at. 'spells' considers each event independently. For tVertexDuration, 'vertices' sums all the spells corresponding to a single vertex id. For edgeDuration, 'edges' sums all of the spells corresponding to a single edge id and 'dyads' sums all of the spells coresponding to a single (directed) tail-head pair (this means spells from multiplex edges conecting the same vertices will be added together).

e

numeric vector of edge ids to consider.

v

numeric vector of vertex ids to consider.

start

optional numeric value to be used to censor onset times. (not yet supported for vertices, must use net.obs.period instead.)

end

optional numeric value to be used to censor terminus times. (not yet supported for vertices, must use net.obs.period instead.)

active.default

logial, should edges or vertices with no timing information be considered always active by default?

Details

The function sums the durations of edge or vertex events or,in order to provide a useful metric for networks having zero-duration events, simply counts them. It is implemented by wrapping a call to as.data.frame.networkDynamic or get.vertex.activity. In many cases the output of the function will be fed to another statistical summary function like summary or hist. The level of aggregation can be selected by setting the subject to either spells, edges, or dyads.

Note that the 'observed' durations may not match the 'true' (statistically estimated) durations for a network due to the censoring of edges/vertices.

Value

A vector of values corresponding to the selected subjects with the count or duration of events. If the network contains no edges/vertices, numeric(0) will be returned.

Note

This is an early implementation of the function and its name and arguments are subject to change

Author(s)

skyebend

See Also

See also as.data.frame.networkDynamic

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# look at the distributions of edge durations for
# a real-world contact network
## Not run: 
require(networkDynamicData)
data(hospital_contact)
summary(edgeDuration(hospital,subject='edges'))
summary(edgeDuration(hospital,mode='counts',subject='edges'))

## End(Not run)
# look at the vertex durations for a network were 
# vertices are not present every day
require(networkDynamic)
data(windsurfers)
vertexDuration(windsurfers)

tsna documentation built on Nov. 1, 2021, 5:06 p.m.