Skip to content

Commit

Permalink
docs: fix example for dfs() as arguments after the dots must be named
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Dec 3, 2024
1 parent 52f4ea5 commit df7edff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions R/structural.properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -2304,9 +2304,13 @@ bfs <- function(
#' @examples
#'
#' ## A graph with two separate trees
#' dfs(make_tree(10) %du% make_tree(10),
#' root = 1, "out",
#' TRUE, TRUE, TRUE, TRUE
#' dfs(
#' graph = make_tree(10) %du% make_tree(10),
#' root = 1, mode = "out",
#' unreachable = TRUE,
#' order = TRUE,
#' order.out = TRUE,
#' parent = TRUE
#' )
#'
#' ## How to use a callback
Expand All @@ -2318,16 +2322,18 @@ bfs <- function(
#' cat("out:", paste(collapse = ", ", data), "\n")
#' FALSE
#' }
#' tmp <- dfs(make_tree(10),
#' root = 1, "out",
#' tmp <- dfs(
#' graph = make_tree(10),
#' root = 1, mode = "out",
#' in.callback = f.in, out.callback = f.out
#' )
#'
#' ## Terminate after the first component, using a callback
#' f.out <- function(graph, data, extra) {
#' data["vid"] == 1
#' }
#' tmp <- dfs(make_tree(10) %du% make_tree(10),
#' tmp <- dfs(
#' graph = make_tree(10) %du% make_tree(10),
#' root = 1,
#' out.callback = f.out
#' )
Expand Down
18 changes: 12 additions & 6 deletions man/dfs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit df7edff

Please sign in to comment.