qread_charinet: Read in character interaction network data from standardised...

View source: R/read_data.R

qread_charinetR Documentation

Read in character interaction network data from standardised input format

Description

A helper function for quickly reading in data recorded in a standardised format wherein certain column orders and variable names are used. For data not meeting this format, read the data in manually.

More specifically, in order to work, the event list should be structured consistently with the format specified elsewhere in this package documentation (at least a sender ID column followed immediately by columns containing binary dummy variables for each character).

Usage

qread_charinet(events_file, nodes_file = NULL, from = 3, check_errors = TRUE)

Arguments

events_file

The event list, containing at least a sender ID column and columns containing binary dummy variables for each character.

nodes_file

The node list, containing as many rows as there are unique characters in the events list. If not supplied, it will be automatically generated from the event list, with character names being inferred from how they appear in the event list.

from

The column containing the numeric sender IDs, followed by dummy variables for each character.

check_errors

If TRUE, the function checks 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.

Value

A named list containing the event list, node list and an adjacency matrix derived from the event list.


pj398/charinet documentation built on May 2, 2024, 10:28 p.m.