tiedDuration: Compute the duration of time (or count of events) that each...

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/durations.R

Description

Computes the total duration that each vertex in the network is tied to other vertices by incident edges. Alternately, if mode="counts", computes the total number of incident edge spells each vertex is tied by. The later is especially useful for continuous time networks tied by edges with 0-duration events. For directed networks, the durations can be filtered using the neighborhood argument to include only incoming, outgoing, or all ties combined in order to return out-tiedor in-tied durations.

Usage

1
2
3
tiedDuration(nd, mode = c("duration", "counts"), 
                     active.default = TRUE, 
                     neighborhood = c("out", "in", "combined"))

Arguments

nd

a networkDynamic object describing the network for which durations should be calculated

mode

either "duration" or "count" indicating if the sum of edge durations or the count of the number of edge events should be returned

active.default

logical, should edges with no defined activity spells be considered active by default?

neighborhood

value of "out", "in" or "combined" indicating if – for directed networks – the durations (counts) should be limited to the vertices' ties outgoing, incoming, or combined (both).

Details

Implemented internally using the as.data.frame.networkDynamic function and so follows the same truncation conventions for handling censored edges (edges that are active before or after the observation window of the network)

Value

a numeric vector of length equal to the number of vertices in the network with a value equal to the sum of durations (or counts) of active edges incident upon the vertex.

Note

Should the default neighborhood for directed network be 'combined'?

Author(s)

skyebend@uw.edu

Examples

1
2
3
4
5
6
7
8
  data(moodyContactSim)
  tiedDuration(moodyContactSim)
  
  data(McFarland_cls33_10_16_96)
  # compute ratio of incoming vs. outgoing speach acts
  outDur <- tiedDuration(cls33_10_16_96, mode='counts',neighborhood = 'out') 
  inDur <- tiedDuration(cls33_10_16_96, mode='counts',neighborhood = 'in')
  outDur / inDur

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