remify | R Documentation |
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,
types = NULL,
riskset = c("full", "active", "manual"),
origin = NULL,
omit_dyad = NULL,
ncores = 1L
)
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 |
can be "tie" or "actor" oriented modeling. This argument plays a fundamental role when |
actors |
[optional] character vector of actors' names that may be observed interacting in the network. If |
types |
[optional] character vector of event types that may occur in the network. If |
riskset |
[optional] character value indicating the type of risk set to process: |
origin |
[optional] starting time point of the observaton period (default is |
omit_dyad |
[optional] list of lists. Each list refers to one risk set modification and must have two objects: a first object named 'time', that is a vector of two values defining the first and last time point of the time window where to apply the change to the risk set and a second object, named 'dyad', which is a |
ncores |
[optional] number of cores used in the parallelization of the processing functions. (default is |
In omit_dyad
, the NA
value can be used to remove multiple objects from the risk set at once with one risk set modification list. For example, to remove all events with sender equal to actor “A” add a list with two objects time = c(NA, NA)
and dyad = data.frame(actor1 = A, actor2 = NA, type = NA)
to the omit_dyad
list. For more details about
'remify' S3 object, list of: number of events ('M'), number of actors ('N'), number of event types (if present, 'C'), number of dyads ('D', and also 'activeD' if 'riskset="active"'), vector of inter-event times (waiting times between two subsequent events), processed input edgelist as 'data.frame', processed 'omit_dyad' object as 'list'. The function returns also several attributes that make efficient the processing of the data for future analysis. For more details about the function, input arguments, output, attributes and methods, please read vignette(package="remify",topic="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
# list of changes of the risk set: each one is a list of:
# 'time' (indicating the time window where to apply the risk set reduction)
# 'dyad' (a data.frame describing the dyads to remove from the risk set
# during the time window specified in 'time')
str(randomREH$omit_dyad)
# -------------------------------------- #
# processing for tie-oriented modeling #
# -------------------------------------- #
tie_randomREH <- remify(edgelist = randomREH$edgelist,
directed = TRUE,
ordinal = FALSE,
model = "tie",
actors = randomREH$actors,
types = randomREH$types,
riskset = "manual",
origin = randomREH$origin,
omit_dyad = randomREH$omit_dyad)
# summary
summary(tie_randomREH)
# dimensions of the processed network
dim(tie_randomREH)
# Which ID is assigned to the actors with names "Francesca" and "Kayla"?
getActorID(x = tie_randomREH, actorName = c("Francesca","Kayla"))
# Which ID is assigned to the event type "conflict"?
getTypeID(x = tie_randomREH, typeName = "conflict")
# Find dyad composition (names of actor1, actor2 and type) from the dyad ID: c(1,380,760,1140)
getDyad(x = tie_randomREH, dyadID = c(1,380,760,1140))
# 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)
# dimensions of the processed network
dim(actor_randomREH)
# ------------------------------------ #
# for more information about remify() #
# check: vignette(package="remify") #
# ------------------------------------ #
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.