Skip to content

Commit 046965c

Browse files
committed
Added grapht() as alias for autographt(), elaborated description, corrected source URL
1 parent 9a9d704 commit 046965c

File tree

4 files changed

+57
-15
lines changed

4 files changed

+57
-15
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ export(ggsave)
313313
export(ggtitle)
314314
export(graphr)
315315
export(graphs)
316+
export(grapht)
316317
export(guides)
317318
export(is.network)
318319
export(is.tbl_graph)

R/map_autographr.R

+22-7
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,34 @@ graphs <- autographs
231231
#' Easily animate dynamic networks with sensible defaults
232232
#'
233233
#' @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.
236247
#' @family mapping
237248
#' @param tlist The same migraph-compatible network listed according to
238249
#' 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.
241251
#' TRUE by default.
242-
#' If FALSE, deletes isolated vertices in each frame.
252+
#' If FALSE, removes nodes from each frame they are isolated in.
243253
#' @inheritParams autographr
244254
#' @importFrom igraph gsize as_data_frame get.edgelist
245255
#' @importFrom ggplot2 ggplot geom_segment geom_point geom_text
246256
#' scale_alpha_manual theme_void
247257
#' @importFrom ggraph create_layout
248258
#' @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.
251262
#' @examples
252263
#' #ison_adolescents %>%
253264
#' # mutate_ties(year = sample(1995:1998, 10, replace = TRUE)) %>%
@@ -374,6 +385,10 @@ autographt <- function(tlist, layout, labels = TRUE,
374385
#' @export
375386
autographd <- autographt
376387

388+
#' @rdname autographt
389+
#' @export
390+
grapht <- autographt
391+
377392
reduce_categories <- function(g, node_group) {
378393
limit <- toCondense <- NULL
379394
if (sum(table(node_attribute(g, node_group)) <= 2) > 2 &

man/autographr.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/autographt.Rd

+33-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)