adj_from_events | R Documentation |
A helper function for extracting an adjacency matrix based on the interactions in an event list.
The event list should be structured consistently with the format specified elsewhere in this package documentation (at least a sender ID column followed by columns containing binary dummy variables for each character).
adj_from_events(event_list, char_names = NULL, from = 3, check_errors = FALSE)
event_list |
The event list, containing at least a sender ID column and columns containing binary dummy variables for each character. |
char_names |
An optional character vector containing node names used to label rows and columns in the adjacency matrix. If not provided, names are inferred from the event list. |
from |
The column containing the sender IDs, followed by dummy variables for each character. |
check_errors |
If TRUE, the function checks the event list for common data input errors. It looks for characters with self-ties, empty rows where no recipient was inputted, and any values other than 1 and 0 in the recipient dummy columns. Returns a message reporting the results of the checks. |
An adjacency matrix aggregated from interactions in an event list.
tfa <- movienetdata::starwars_tfa
tfa_adj <- adj_from_events(event_list = tfa$event_list,
char_names = tfa$node_list$char_name,
check_errors = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.