dot-remify_durem_init: Internal constructor for 'remify_durem' objects

.remify_durem_initR Documentation

Internal constructor for remify_durem objects

Description

Called by remify when duration = TRUE. Normalises and validates the duration edgelist, builds a standard remify object from the start events (to obtain the actor dictionary and risk set structure), and attaches a $durem slot with all duration-specific metadata.

Usage

.remify_durem_init(
  edgelist,
  directed = TRUE,
  ordinal = FALSE,
  model = "tie",
  aggregate_time = 1L,
  actors = NULL,
  riskset = c("full", "active", "active_saturated", "manual"),
  manual_riskset = NULL,
  extend_riskset_by_type = FALSE,
  event_type = NULL,
  origin = NULL,
  time_units = c("auto", "secs", "mins", "hours", "days", "weeks", "months", "years"),
  attach_riskset = TRUE,
  riskset_decode = c("labels", "ids", "none"),
  riskset_max_decode = 200000L,
  event_attributes = NULL,
  ncores = 1L,
  omit_dyad = NULL,
  directed_end = FALSE,
  type_exclusive = FALSE
)

Arguments

edgelist

the relational event history. An object of class data.frame with first three columns corresponding to time, and actors forming the dyad. The first three columns will be re-named "time", "actor1", "actor2" (where, for directed networks, "actor1" corresponds to the sender and "actor2" to the receiver of the relational event). Optional columns that can be supplied are: 'type' and 'weight'. If one or both exist in edgelist, they have to be named accordingly.

directed

logical value indicating whether events are directed (TRUE) or undirected (FALSE). (default value is TRUE)

ordinal

logical value indicating whether only the order of events matters in the model (TRUE) or also the exact timing must be considered in the model (FALSE). (default value is FALSE). If TRUE, then the column "time" of edgelist is still used to extract the order.

model

either "tie" (default) or "actor" oriented modeling. For "tie", the riskset is at the dyad level. For "actor", the model has two sub-processes: a sender rate model (who sends next?) and a receiver choice model (who does the sender choose?). Actor-oriented modeling requires directed=TRUE. The returned object includes sender_riskset, receiver_riskset, and activeN (see @return).

aggregate_time

Integer >= 1. Event-time aggregated based on unique time points. Keeps every aggregate_time-th unique event time (after time translation) and maps each event time to the next kept time point (i.e., ceiling to the kept grid). This reduces the number of unique time points (and thus memory/computation in later steps).

actors

[optional] character vector of actors' names that may be observed interacting in the network. If NULL (default), actors' names will be taken from the input edgelist.

riskset

[optional] character value indicating the type of risk set to process: riskset = "full" (default) consists of all the possible dyadic events given the number of actors (and the number of event types) and it mantains the same structure over time. riskset = "active" considers at risk only the observed dyads and it mantains the same structure over time. riskset = "manual", allows the risk set to have a structure that is user-defined, and it is based on the instructions supplied via the argument manual_riskset. riskset = "active_saturated" extends the active riskset by adding the reverse direction for each observed dyad (if A->B is observed, B->A is also at risk) and includes all event types for each observed actor pair (type column is ignored). This reflects the assumption that observing any interaction between two actors implies both directions and all types are possible.

manual_riskset

[optional] When riskset = "manual", this argument of class data.frame specifies which dyadic riskset to consider through the entire sequence. If observed dyads from the edgelist are missing, they will be automatically be added.

extend_riskset_by_type

logical. FALSE (default). When event types are present (via event_type), controls whether the risk set is expanded over types. If TRUE (default when types are present), each actor pair is duplicated for each event type, so the risk set has size D = N(N-1) \times C (directed) or D = N(N-1)/2 \times C (undirected), and the type column appears in the decoded risk set. If FALSE, event type is treated as a mark on events only and does not expand the risk set: D = N(N-1) (directed) or D = N(N-1)/2 (undirected), and no type column appears in the decoded risk set. This argument is ignored when no event types are present.

event_type

Optional. Either NULL (default) or a single character string giving the name of the column in edgelist that contains event types (marks).

If event_type is NULL, remify() uses edgelist$type if it exists; otherwise events are treated as untyped.

If event_type is a column name, that column is used as the event-type mark. If a column named type already exists and event_type != "type", the existing edgelist$type is overridden (with a warning).

When event types are present (via edgelist$type or event_type), the dyadic risk set is extended over types, i.e., each dyad is duplicated for each event type (dyad \times type).

origin

[optional] starting time point of the observation period (default is NULL). If it is supplied, it must have the same class of the 'time' column in the input edgelist. If unsupplied, the origin is set to the average waiting time in the sequence subtracted from the time of the first event.

time_units

Character string specifying the time unit for converting time values when 'edgelist$time' is of class Date or POSIXct; ignored for numeric or integer time. Default is "secs".

attach_riskset

Logical. If TRUE, attaches a list riskset_info to the returned remify object. The list contains the effective risk set representation used for estimation (e.g., riskset_idx, dyadIDactive, dictionaries, and basic risk set metadata). This is intended to make the returned object self-describing and easier to inspect/debug.

riskset_decode

Character. Controls how (and whether) the included risk set dyads are decoded and attached in riskset_info$included.

"labels"

Attach a decoded dyad table including actor (and type) labels (e.g., actor1, actor2, and optional type).

"ids"

Attach a decoded dyad table with integer IDs only (e.g., actor1ID, actor2ID, optional typeID, and dyadID).

"none"

Do not attach a decoded dyad table.

riskset_max_decode

Integer. Maximum number of included dyads (i.e., length(riskset_idx) / D_active) for which riskset_decode="labels" is allowed. If the included risk set exceeds this threshold, decoding to labels is skipped (typically falling back to "ids" with a warning) to avoid large memory usage.

event_attributes

Optional character vector of column names in edgelist to retain as additional event-level variables in the returned reh object.

These columns are stored as reh$event_attributes together with the corresponding time, actor1, and actor2 columns (and an internal .event_id). This is useful when downstream functions (e.g., in remstats) need access to event-level marks/attributes/covariates that are not part of the core reh$edgelist produced by remify().

Note: event_attributes does not affect risk set construction or type handling in remify(); it only preserves additional columns for later use. Currently there is no further support yet when event_attributes have been added.

ncores

[optional] number of cores used in the parallelization of the processing functions. (default is 1).

directed_end

Logical. FALSE (default) means the end process is undirected: either actor can terminate the event and only a combined dyad-level end rate is modelled (TOM end). TRUE means the end process is directed: a who_ended column in the edgelist records which actor terminated each event. When who_ended is present, actor- level end rates are separately estimable (competing risks / AOM end). When who_ended is absent, actor1 is assumed to terminate all events and a message is issued.

type_exclusive

Logical. Only relevant when extend_riskset_by_type = TRUE. If TRUE, an active event of any type is a hard block on starting events of all other types for the same dyad. Default FALSE.

Value

An object of class c("remify_durem", "remify").


remify documentation built on July 13, 2026, 5:08 p.m.