dynam_event_dyad: Format edge list for DyNAM

View source: R/rem.R

dynam_event_dyadR Documentation

Format edge list for DyNAM

Description

Convert a dyadic event list into an edge list to be used with the goldfish package (DyNAM) model. The input data contains sender and receiver and is timestamped. The DyNAM model requires certain naming conventions and data type formats, to be delivered by this function.

Usage

dynam_event_dyad(
  x,
  twl = 0,
  vprefix = NULL,
  vpostfix = NULL,
  use.labels = F,
  time = 1,
  ...
)

Arguments

x

Dyadic data. Accepted formas are "matrix" (adjacency), "network" or "edgelist" objects (sna package), "interact" data frame.

twl

Numeric. Indicates the time window length to cluster (merge) interactions together. This is passed to twl of cluster_ts.

vprefix

String prefix for labeling vertices. This is useful in relation to matrix where col or row names might be just numbers while vertices are names.

vpostfix

String postfix for labeling vertices.

time

POSIXct time object for event list.

use.lables

Logical. In case a network/edgelist object is used, indicates ifthe associated vertice names should be copied or not.

Value

Object of type data.frame to be used with the DyNAM model.

Examples

#Construct DyNAM edge list from "advice" network matrix
adv <- matrix(c(0,0,1, 1,0,0, 1,1,1), nrow=3, ncol=3)

#without names
dynam_event_dyad(adv)

#with node prefix
dynam_event_dyad(adv, vprefix="Node_")


jmueller17/sociometrics documentation built on March 20, 2024, 1:04 a.m.