multicast_to_dyadic | R Documentation |
Convert a time-ordered multicast event list into a dyadic from-to format, preserving other event-level variables.
multicast_to_dyadic(event_list, from = 3, force_seq = FALSE)
event_list |
A multicast event list containing a column of sender IDs followed immediately by dummy variables for each character. |
from |
The column containing the sender IDs. |
force_seq |
Logical. If TRUE, events with multiple recipients will be forced into a false sequence, and each row in the dyadic event list will increment the event ID variable. If FALSE, multicast events will be split into the dyadic components, but the event ID variable will indicate that these dyadic events are simultaneous. |
A time-ordered dyadic event list (as a matrix).
tfa <- movienetdata::starwars_tfa
# Convert The Force Awakens event list to dyadic format
tfa_dyads <- multicast_to_dyadic(tfa$event_list,
from = 3)
# And convert it back to multicast format
tfa_events <- dyadic_to_multicast(event_list = tfa_dyads,
from = 4,
to = 5,
time_col = 1,
char_names = tfa$node_list$char_name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.