as_cascade_long: Transform long data to cascade

Description Usage Arguments Details Value Examples

Description

Create a cascade object from data in long format.

Usage

1
2
3
as_cascade_long(data, cascade_node_name = "node_name",
  event_time = "event_time", cascade_id = "cascade_id",
  node_names = NULL)

Arguments

data

data.frame, containing the cascade data with column names corresponding to the arguments provided to cascade_node_names, event_time and cascade_id.

cascade_node_name

character, column name of data that specifies the node names in the cascade.

event_time

character, column name of data that specifies the event times for each node involved in a cascade.

cascade_id

character, column name of the cascade identifier.

node_names

character, factor or numeric vector containing the names for each node. Optional. If not provided, node names are inferred from the cascade data.

Details

Each row of the data describes one event in the cascade. The data must contain at least three columns:

  1. Cascade node name: The identifier of the node that experiences the event.

  2. Event time: The time when the node experiences the event. Note that if the time column is of class date or any other special time class, it will be converted to an integer with 'as.numeric()'.

  3. Cascade id: The identifier of the cascade that the event pertains to.

The default names for these columns are node_name, event_time and cascade_id. If other names are used in the data object the names have to be specified in the corresponding arguments (see argument documentation)

Value

An object of class cascade. This is a list containing three (named) elements:

  1. "node_names" A character vector of node names.

  2. "cascade_nodes" A list with one character vector per cascade containing the node names in order of the events.

  3. "cascade_times" A list with one element per cascade containing the event times for the nodes in "cascade_names".

Examples

1
2
3

desmarais-lab/NetworkInference documentation built on May 15, 2019, 5:05 a.m.