| Title: | Processing and Transforming Relational Event History Data |
|---|---|
| Description: | Efficiently processes relational event history data and transforms them into formats suitable for other packages. The primary objective of this package is to convert event history data into a format that integrates with the packages in 'remverse' and is compatible with various analytical tools (e.g., computing network statistics, estimating tie-oriented or actor-oriented social network models). Second, it can also transform the data into formats compatible with other packages out of 'remverse'. The package processes the data for two types of temporal social network models: tie-oriented modeling framework (Butts, C., 2008, <doi:10.1111/j.1467-9531.2008.00203.x>) and actor-oriented modeling framework (Stadtfeld, C., & Block, P., 2017, <doi:10.15195/v4.a14>). |
| Authors: | Giuseppe Arena [aut, cre] (ORCID: <https://orcid.org/0000-0001-5204-3326>), Joris Mulder [aut], Rumana Lakdawala [ctb], Marlyne Meijerink-Bosman [ctb], Diana Karimova [ctb], Fabio Generoso Vieira [ctb], Mahdi Shafiee Kamalabad [ctb], Roger Leenders [ctb] |
| Maintainer: | Giuseppe Arena <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 4.1.0 |
| Built: | 2026-07-11 09:21:23 UTC |
| Source: | https://github.com/tilburgnetworkgroup/remify |
A function that returns the dimension of the temporal network.
## S3 method for class 'remify' dim(x)## S3 method for class 'remify' dim(x)
x |
a |
vector of dimensions of the processed event sequence.
# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # dimensions of the processed 'remify' object dim(reh)# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # dimensions of the processed 'remify' object dim(reh)
A randomly generated relational event history dataset for testing and examples.
historyhistory
A data frame that can be used for an analysis with remverse
remify_durem
Test whether an object is a remify_durem
is.remify_durem(x)is.remify_durem(x)
x |
Any R object. |
TRUE if x inherits from "remify_durem".
several plots that describe the network of relational events, both for directed and undirected relational events.
## S3 method for class 'remify' plot( x, which = c(1:10), breaks = 15L, palette = "Purples", n_intervals = 10L, rev = TRUE, actors = NULL, pch.degree = 20, igraph.edge.color = "#4daa89", igraph.vertex.color = "#5AAFC8", ... )## S3 method for class 'remify' plot( x, which = c(1:10), breaks = 15L, palette = "Purples", n_intervals = 10L, rev = TRUE, actors = NULL, pch.degree = 20, igraph.edge.color = "#4daa89", igraph.vertex.color = "#5AAFC8", ... )
x |
is a |
which |
one or more numbers between 1 and 7. Plots described in order: (1) distribution of the inter-event times
(histogram), (2) tile plot titled 'activity plot', with in-degree and out-degree activity line plots on the sides (or
total-degree on the top side if the network is undirected). Tiles' color is scaled based on the count of the directed
(or undirected) dyad, (3) for directed networks two plots of normalized out-degree and in-degree (values ranging in [0,1])
over a set of |
breaks |
default is |
palette |
a palette from |
n_intervals |
number of time intervals for time plots (default is |
rev |
default is TRUE (reverse order of the color specified in |
actors |
default is the set of actors in the network (see |
pch.degree |
default is 20. Shape of the points for the degree plots (in-degree, out-degree, total-degree). |
igraph.edge.color |
color of the edges in visualization of the network with vertices and nodes. The user can specify the hex
value of a color, the color name or use the function |
igraph.vertex.color |
color of the vertices in visualization of the network with vertices and nodes. The user can specify the
hex value of a color, the color name or use the function |
... |
other graphical parameters |
Generic plot method
no return value, called for plotting descriptives on the relational event history data.
print a summary of the event history.
## S3 method for class 'remify' print(x, ...)## S3 method for class 'remify' print(x, ...)
x |
a |
... |
further arguments. |
displays the same information provided by the summary method.
# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # printing a summary of the processed 'remify' object print(reh)# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # printing a summary of the processed 'remify' object print(reh)
remify_durem
Mirrors print.remify: delegates to summary.remify_durem.
## S3 method for class 'remify_durem' print(x, ...)## S3 method for class 'remify_durem' print(x, ...)
x |
A |
... |
Passed to |
A randomly generated sequence of relational events with 20 actors and 9915 events. Each event type is associated to one of the three following sentiments: conflict, competition and cooperation.
randomREHrandomREH
data(randomREH) will load a list containing following objects:
edgelista data.frame that contains the random sequence of events. Columns of the edgelist are:
timethe timestamp indicating the time at which each event occurred;
actor1the name of the actor that generated the relational event;
actor2the name of the actor that received the relational event;
typethe type of the relational event.
actorsnames of actors interacting in the dynamic network.
typesnames of event types observed in the network and describing the sentiment of the interaction (conflict, competition and cooperation).
originstarting time point (t_0) prior to the first observed event (t_1), the class of this object must be the same as the one of the time column in the edgelist.
omit_dyada list where each element describes an alteration of the riskset which takes place at specific time points and for certain actors and/or types.
data(randomREH) # actors names randomREH$actors # types names randomREH$types # run the preprocessing function reh() by supplying the loaded objects. edgelist_reh <- remify(edgelist = randomREH$edgelist, actors = randomREH$actors, directed = TRUE, ordinal = FALSE, origin = randomREH$origin, model = "tie") # `edgelist_reh` is an object of class `remify` class(edgelist_reh) # names of objects inside `edgelist_reh` names(edgelist_reh)data(randomREH) # actors names randomREH$actors # types names randomREH$types # run the preprocessing function reh() by supplying the loaded objects. edgelist_reh <- remify(edgelist = randomREH$edgelist, actors = randomREH$actors, directed = TRUE, ordinal = FALSE, origin = randomREH$origin, model = "tie") # `edgelist_reh` is an object of class `remify` class(edgelist_reh) # names of objects inside `edgelist_reh` names(edgelist_reh)
A subset from the randomly generated sequence of relational events 'randomREH', with 5 actors and 586 events (without event types).
randomREHsmallrandomREHsmall
data(randomREHsmall) will load a list containing following objects:
edgelista data.frame that contains the random sequence of events. Columns of the edgelist are:
timethe timestamp indicating the time at which each event occurred;
actor1the name of the actor that generated the relational event;
actor2the name of the actor that received the relational event;
actorsnames of actors interacting in the dynamic network.
originstarting time point (t_0) prior to the first observed event (t_1), the class of this object must be the same as the one of the time column in the edgelist.
omit_dyada list where each element describes an alteration of the riskset which takes place at specific time points and for certain actors and/or types.
data(randomREHsmall) # actors names randomREHsmall$actors # types names randomREHsmall$types # run the preprocessing function reh() by supplying the loaded objects. small_edgelist_reh <- remify(edgelist = randomREHsmall$edgelist, actors = randomREHsmall$actors, directed = TRUE, ordinal = FALSE, origin = randomREHsmall$origin, model = "tie") # `small_edgelist_reh` is an object of class `reh` class(small_edgelist_reh) # names of objects inside `small_edgelist_reh` names(small_edgelist_reh)data(randomREHsmall) # actors names randomREHsmall$actors # types names randomREHsmall$types # run the preprocessing function reh() by supplying the loaded objects. small_edgelist_reh <- remify(edgelist = randomREHsmall$edgelist, actors = randomREHsmall$actors, directed = TRUE, ordinal = FALSE, origin = randomREHsmall$origin, model = "tie") # `small_edgelist_reh` is an object of class `reh` class(small_edgelist_reh) # names of objects inside `small_edgelist_reh` names(small_edgelist_reh)
A function that processes raw relational event history data and returns a S3 object of class 'remify' which is used as input in other functions inside 'remverse'.
remify( edgelist, directed = TRUE, ordinal = FALSE, model = c("tie", "actor"), actors = NULL, riskset = c("full", "active", "active_saturated", "manual"), manual_riskset = NULL, extend_riskset_by_type = FALSE, event_type = NULL, event_weight = NULL, origin = NULL, time_units = c("auto", "secs", "mins", "hours", "days", "weeks", "months", "years"), aggregate_time = 1, attach_riskset = TRUE, riskset_decode = c("labels", "ids", "none"), riskset_max_decode = 200000L, event_attributes = NULL, ncores = 1L, duration = FALSE, dur_directed_end = FALSE, dur_type_exclusive = FALSE )remify( edgelist, directed = TRUE, ordinal = FALSE, model = c("tie", "actor"), actors = NULL, riskset = c("full", "active", "active_saturated", "manual"), manual_riskset = NULL, extend_riskset_by_type = FALSE, event_type = NULL, event_weight = NULL, origin = NULL, time_units = c("auto", "secs", "mins", "hours", "days", "weeks", "months", "years"), aggregate_time = 1, attach_riskset = TRUE, riskset_decode = c("labels", "ids", "none"), riskset_max_decode = 200000L, event_attributes = NULL, ncores = 1L, duration = FALSE, dur_directed_end = FALSE, dur_type_exclusive = FALSE )
edgelist |
the relational event history. An object of class |
directed |
logical value indicating whether events are directed ( |
ordinal |
logical value indicating whether only the order of events matters in the model ( |
model |
either |
actors |
[optional] character vector of actors' names that may be observed interacting in the network. If |
riskset |
[optional] character value indicating the type of risk set to process: |
manual_riskset |
[optional] When |
extend_riskset_by_type |
logical. |
event_type |
Optional. Either If If When event types are present (via |
event_weight |
Optional. Either If If |
origin |
[optional] starting time point of the observation period (default is |
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". |
aggregate_time |
Integer >= 1. Event-time aggregated based on unique time points.
Keeps every |
attach_riskset |
Logical. If |
riskset_decode |
Character. Controls how (and whether) the included risk set
dyads are decoded and attached in
|
riskset_max_decode |
Integer. Maximum number of included dyads (i.e.,
|
event_attributes |
Optional character vector of column names in
These columns are stored as Note: |
ncores |
[optional] number of cores used in the parallelization of the processing functions. (default is |
duration |
Logical. If |
dur_directed_end |
Logical. Only used when |
dur_type_exclusive |
Logical. Only used when |
A remify S3 object (list) with the following elements:
M number of events (or unique time points if simultaneous events exist).
N number of actors.
C number of event types (1 if untyped).
D number of dyads in the riskset.
intereventTime vector of inter-event waiting times (NULL if ordinal=TRUE).
edgelist processed input edgelist as data.frame.
edgelist_id per-event integer ID summary.
edgelist_dual processed input edgelist with duration as data.frame.
meta list of metadata (model, directed, ordinal, riskset, dictionary, etc.).
ids list of per-event integer IDs (actor1, actor2, dyad, type).
index list of decoded riskset tables (dyad_map or dyad_map_active for tie model; sender_map for actor model).
activeD number of active dyads (tie model, riskset="active" or "manual" only).
riskset_info decoded riskset metadata (tie model only, when attach_riskset=TRUE).
durem list of metadata for events with duration.
For actor-oriented models (model="actor"), the following additional elements are returned:
sender_riskset integer vector of actor IDs allowed to send (all actors for "full"; observed senders for "active"; senders in manual_riskset for "manual"/"active_saturated").
receiver_riskset named list (actor names) of integer vectors of allowed receiver IDs per sender. Depends on the chosen riskset vie the argument riskset.
activeN number of active senders.
index\$sender_map data.frame with columns senderID and actorName for active senders.
# load package and random network 'randomREH' library(remify) data(randomREH) # first events in the sequence head(randomREH$edgelist) # actor's names randomREH$actors # event type's names randomREH$types # start time of the study (origin) randomREH$origin # -------------------------------------- # # processing for tie-oriented modeling # # -------------------------------------- # tie_randomREH <- remify(edgelist = randomREH$edgelist, directed = TRUE, ordinal = FALSE, model = "tie", origin = randomREH$origin) # summary summary(tie_randomREH) # visualize descriptive measures of relational event data plot(x = tie_randomREH) # -------------------------------------- # # processing for actor-oriented modeling # # -------------------------------------- # # loading network 'randomREHsmall' data(randomREHsmall) # processing small random network actor_randomREH <- remify(edgelist = randomREHsmall$edgelist, directed = TRUE, ordinal = FALSE, model = "actor", actors = randomREHsmall$actors, origin = randomREHsmall$origin) # summary summary(actor_randomREH) # visualize plot(actor_randomREH) # ------------------------------------ # # for more information about remify() # # check: vignette(package="remify") # # ------------------------------------ ## load package and random network 'randomREH' library(remify) data(randomREH) # first events in the sequence head(randomREH$edgelist) # actor's names randomREH$actors # event type's names randomREH$types # start time of the study (origin) randomREH$origin # -------------------------------------- # # processing for tie-oriented modeling # # -------------------------------------- # tie_randomREH <- remify(edgelist = randomREH$edgelist, directed = TRUE, ordinal = FALSE, model = "tie", origin = randomREH$origin) # summary summary(tie_randomREH) # visualize descriptive measures of relational event data plot(x = tie_randomREH) # -------------------------------------- # # processing for actor-oriented modeling # # -------------------------------------- # # loading network 'randomREHsmall' data(randomREHsmall) # processing small random network actor_randomREH <- remify(edgelist = randomREHsmall$edgelist, directed = TRUE, ordinal = FALSE, model = "actor", actors = randomREHsmall$actors, origin = randomREHsmall$origin) # summary summary(actor_randomREH) # visualize plot(actor_randomREH) # ------------------------------------ # # for more information about remify() # # check: vignette(package="remify") # # ------------------------------------ #
A function that returns a easy-to-read summary of the main characteristics as to the processed relational event sequence.
## S3 method for class 'remify' summary(object, ...)## S3 method for class 'remify' summary(object, ...)
object |
a |
... |
other arguments. |
prints out the main characteristics of the processed relational event sequence.
# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # printing a summary of the processed 'remify' object summary(reh)# processing the random network 'randomREHsmall' library(remify) data(randomREHsmall) reh <- remify(edgelist = randomREHsmall$edgelist, model = "tie") # printing a summary of the processed 'remify' object summary(reh)
remify_durem
Produces output in the same format as summary.remify, with the
model line extended to read "(processed for tie-oriented modeling with
duration)" and DuREM-specific fields (start/end direction, duration
statistics) appended at the end.
## S3 method for class 'remify_durem' summary(object, ...)## S3 method for class 'remify_durem' summary(object, ...)
object |
A |
... |
Ignored. |