make_dyads: Aggregate events to a regular time interval

Description Usage Arguments Details Value Author(s)

View source: R/events.R

Description

Aggregates events to a regular time interval

Usage

1
2
3
make_dyads(edo, scale = NULL, unit = "week", monday = TRUE,
  fun = function(x) {     mean(x, na.rm = TRUE) }, missing.data = NA,
  actors = NULL)

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

actors

An array of actor names from which to construct dyads.

Details

In an event data set S, assume that A=length(actors(S)) actors K=length(codes(S)) event codes occur. This function creates (by default) 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 evenly spaced univariate interval-valued time series, possibly with missing data, for each directed dyad.

Value

A list of named dyadic aggregated time series

Author(s)

Will Lowe


conjugateprior/events documentation built on May 13, 2019, 9:56 p.m.