@@ -231,23 +231,34 @@ graphs <- autographs
231
231
# ' Easily animate dynamic networks with sensible defaults
232
232
# '
233
233
# ' @description
234
- # ' The aim of this function is to provide users with a quick and easy
235
- # ' graphing function to produce animated network visualisations.
234
+ # ' This function provides users with an easy way to graph
235
+ # ' dynamic network data for exploration and presentation.
236
+ # '
237
+ # ' It builds upon this package's `autographr()` function,
238
+ # ' and inherits all the same features and arguments.
239
+ # ' See `autographr()` for more.
240
+ # ' However, it uses the `{gganimate}` package to animate the changes
241
+ # ' between successive iterations of a network.
242
+ # ' This is useful for networks in which the ties and/or the node or tie
243
+ # ' attributes are changing.
244
+ # '
245
+ # ' A progress bar is shown if it takes some time to encoding all the
246
+ # ' .png files into a .gif.
236
247
# ' @family mapping
237
248
# ' @param tlist The same migraph-compatible network listed according to
238
249
# ' a time attribute, waves, or slices.
239
- # ' @param keep_isolates Would you like to remove vertices that do not have
240
- # ' any adjacent edges in each frame?
250
+ # ' @param keep_isolates Logical, whether to keep isolate nodes in the graph.
241
251
# ' TRUE by default.
242
- # ' If FALSE, deletes isolated vertices in each frame.
252
+ # ' If FALSE, removes nodes from each frame they are isolated in .
243
253
# ' @inheritParams autographr
244
254
# ' @importFrom igraph gsize as_data_frame get.edgelist
245
255
# ' @importFrom ggplot2 ggplot geom_segment geom_point geom_text
246
256
# ' scale_alpha_manual theme_void
247
257
# ' @importFrom ggraph create_layout
248
258
# ' @importFrom dplyr mutate select distinct left_join %>%
249
- # ' @source http://blog.schochastics.net/post/animating-network-evolutions-with-gganimate/
250
- # ' @return A gganimate::animate() object.
259
+ # ' @source https://blog.schochastics.net/posts/2021-09-15_animating-network-evolutions-with-gganimate/
260
+ # ' @return Shows a .gif image. Assigning the result of the function
261
+ # ' saves the gif to a temporary folder and the object holds the path to this file.
251
262
# ' @examples
252
263
# ' #ison_adolescents %>%
253
264
# ' # mutate_ties(year = sample(1995:1998, 10, replace = TRUE)) %>%
@@ -374,6 +385,10 @@ autographt <- function(tlist, layout, labels = TRUE,
374
385
# ' @export
375
386
autographd <- autographt
376
387
388
+ # ' @rdname autographt
389
+ # ' @export
390
+ grapht <- autographt
391
+
377
392
reduce_categories <- function (g , node_group ) {
378
393
limit <- toCondense <- NULL
379
394
if (sum(table(node_attribute(g , node_group )) < = 2 ) > 2 &
0 commit comments