dyadic_to_multicast | R Documentation |
This function converts a time-ordered event list in a dyadic edge-list style format with a 'from' column and a 'to' column into a multicast format as used by this package with receiver dummy variables after the from column. If the dyadic event list contains a column indicating the time or event ID, this can be specified to collect multiple simultaneous dyadic events spread across multiple rows into a single row in the multicast event list.
dyadic_to_multicast(
event_list,
from = 1,
to = 2,
time_col = NULL,
char_names = NULL
)
event_list |
A time-ordered dyadic event list. |
from |
The numerical index of the 'from' column in |
to |
The numerical index of the 'to' column in |
time_col |
The numerical index of the column in |
char_names |
An optional character vector of character names, ordered by character ID, used to label the columns. |
A time-ordered multicast 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.