Learn R Programming

events (version 0.5)

make_dyads: Aggregate events to a regular time interval

Description

Aggregates events to a regular time interval

Usage

make_dyads(edo, scale = NULL, unit = c("week", "day", "month", "quarter", "year"), monday = TRUE, fun = mean, missing.data = NA)

Arguments

edo
Event data
scale
Name of an eventscale or NULL to create counts
unit
Temporal aggregation unit
monday
Whether weeks start on Monday. If FALSE, they start on Sunday
fun
Aggregation function. Should take a vector and return a scalar
missing.data
What weeks with no data are assigned

Value

A list of named dyadic aggregated time series

Details

In an event data set S, assume that $A$=length(actors(S)) actors $K$=length(codes(S)) event codes occur. This function creates $A^2$ data streams labelled by the combination of source and target actors. If scale is NULL these are $K$-dimensional time series of event counts. If scale names a scale that has been added to the event data fun is used to aggregate the events falling into each temporal interval. This creates a univariate interval valued time series for each directed dyad.