Skip to contents

returns a ggplot built from the per-period plot.netify() output, with gganimate::transition_manual() keyed on the time variable so the animation steps through each period. requires the gganimate package.

Usage

animate_netify(netlet, ..., static_actor_positions = TRUE)

Arguments

netlet

a longitudinal netify object (longit_array / longit_list).

...

additional arguments passed to plot.netify() (node_color_by, node_size_by, style, etc.).

static_actor_positions

logical. if TRUE (default for animation since positions jumping around between periods is visually confusing), pin node positions across time.

Value

a gganim object. render with gganimate::animate(.) or gganimate::anim_save("file.gif", .).

Details

for static facet plots, just call plot(net) on a longit netlet – that defaults to faceting by time. use animate_netify() for single-panel transitions instead of grid faceting (better for presentations / videos where the eye can focus on one period at a time).

Author

cassy dorff, shahryar minhas

Examples

# \donttest{
data(classroom_edges)
classroom_panel <- rbind(
    transform(classroom_edges[1:12, ], wave = 1),
    transform(classroom_edges[13:24, ], wave = 2)
)

longit_net <- netify(
    classroom_panel,
    actor1 = "from", actor2 = "to", time = "wave",
    symmetric = TRUE,
    missing_to_zero = TRUE
)

anim <- animate_netify(longit_net)
# }