tDegree: Report momentary degree of a networkDynamic object at...

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

View source: R/degree.R

Description

Calculates the degree of vertices at a sequence of time points over a network's temporal evolution

Usage

1
tDegree(nd, start, end, time.interval = 1, cmode = c("freeman", "indegree", "outdegree"))

Arguments

nd

the networkDynamic object to be evaluated

start

optional numeric time value at which evaluation should start (default is first observed time)

end

optional numeric time value at which evaluation should end (default is last observed time)

time.interval

optional numeric value giving time interval between evaluations (default is 1)

cmode

mode for evaluating degree. one of "freeman", "indegree", "outdegree"

Details

Evaluates the momentary degrees of a network at multiple time points and returns results in a form suitable for sumarizing the distributions. If a vertex is not active at a time point, its degree will be recorded as NA.

Value

A ts (time series) object, a numeric matrix with giving the momentary degree of each vertex at each time point. Columns coresponding to each vertex in the input network and row corresponding to each time point at which degree was evaluated.

Author(s)

skyebend

See Also

See also tSnaStats(nd,'degree') and tErgmStats(nd,'sociality') for alternate ways to compute degree using external packages.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(McFarland_cls33_10_16_96)
tDegree(cls33_10_16_96)
# compute mean temporal degree
mean(tDegree(cls33_10_16_96),na.rm=TRUE)
## Not run: 
library(networkDynamicData)
data(concurrencyComparisonNets)
# compute mean for each network, sampled at 11 time points
mean(colMeans(tDegree(base,start = 0,end=102,time.interval = 10)))
mean(colMeans(tDegree(middle,start = 0,end=102,time.interval = 10)))
mean(colMeans(tDegree(monog,start = 0,end=102,time.interval = 10)))

# plot distribution of vertices' mean momentary degree
hist(rowMeans(tDegree(base,start = 0,end=102,time.interval = 10)))

# plot distribution of momentary degrees of vertices
hist(tDegree(base,start = 0,end=102,time.interval = 10))

## End(Not run)

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