manip_changes {manynet} | R Documentation |
Modifying changes to nodes over time
Description
These functions offer ways to modify data held about how nodes change over time. They include:
-
add_changes()
adds a table of changes to the nodes of a network. -
mutate_changes()
can be used to update network changes. -
filter_changes()
is used to subset network changes. -
collect_changes()
is similar tofilter_changes()
, but collects the cumulative changes up to a time point. -
apply_changes()
applies the changes collected up to a time point to a network, removing the changes.
An example of when this might be useful is to track change in the composition of a network (when nodes are present or absent over time), though the function can flexibly accommodate changes in other nodal attributes.
Usage
add_changes(.data, changes)
mutate_changes(.data, ...)
filter_changes(.data, ..., .by = NULL)
select_changes(.data, ..., .by = NULL)
collect_changes(.data, time)
apply_changes(.data, time)
Arguments
.data |
An object of a manynet-consistent class:
|
changes |
A data frame of changes. Ideally this will be in the form of "wave", "node", "var", and "value", but there are internal routines from some otherwise common formats. A data frame of composition change can be just two columns. |
... |
Additional arguments. |
.by |
An attribute name to join objects by. By default, NULL. |
time |
A time point or wave at which to present the network. |
See Also
Examples
add_changes(ison_algebra,
data.frame(wave = 2, node = 1, var = "active", value = FALSE))
filter_changes(fict_starwars, node == "Anakin")
select_changes(fict_starwars, node)
collect_changes(fict_starwars, time = 3)
collect_changes(fict_starwars, time = 3)