actors <- data.frame(
actor = 1:5, label = paste("Actor", 1:5),
present = TRUE, gender = sample.int(2, 5, replace = TRUE)
)
actors <- defineNodes(nodes = actors)
calls <- data.frame(
time = c(12, 27, 45, 56, 66, 68, 87),
sender = paste("Actor", c(1, 3, 5, 2, 3, 4, 2)),
receiver = paste("Actor", c(4, 2, 3, 5, 1, 2, 5)), increment = rep(1, 7)
)
callNetwork <- defineNetwork(nodes = actors)
callNetwork <- linkEvents(
x = callNetwork, changeEvent = calls, nodes = actors
)
# Defining the dependent events:
callDependent <- defineDependentEvents(
events = calls, nodes = actors, defaultNetwork = callNetwork
)
Run the code above in your browser using DataLab