Skip to contents

get_actor_time_info takes in a longitudinal dyadic dataset and computes when actors entered and exited the network. Entering will be determined by the first period the actor had an interaction and exiting by the last period.

Usage

get_actor_time_info(dyad_data, actor1, actor2, time)

Arguments

dyad_data

a dyadic dataframe

actor1

character: actor 1 in the data

actor2

character: actor 2 in the data

time

character: time in the data

Value

a dataframe with three columns:

actor

a column indicating actors in the data

min_time

a column indicating the first time point in which the actor should be considered a part of the network

max_time

a column indicating the last time point in which the actor should be considered a part of the network

Author

Shahryar Minhas, Ha Eun Choi

Examples

if (FALSE) { # \dontrun{
library(peacesciencer)
library(dplyr)

cow_dyads <- create_dyadyears(
  subset_years = c(1980:2001)
  ) %>%
  # add mids
  add_cow_mids()

actor_time <- get_actor_time_info(
  dyad_data = cow_dyads, 
  actor1 = 'ccode1', 
  actor2 = 'ccode2', 
  time = 'year'
)
} # }