From 567ba3ffddce80c88f8ce21ebd07ecf4658ec8a2 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 15 Oct 2026 21:28:35 +0200 Subject: [PATCH 1/4] refactor: Rename iteration arguments to `n_iter`/`max_iter` Fixed iteration counts become `n_iter`, caps that may stop early become `max_iter`, per the #2788 decision. Legacy names are recovered with a soft-deprecation. Part of #2788. Co-Authored-By: Claude Opus 5.5 (1M context) --- R/community.R | 14 +-- R/glet.R | 26 ++--- R/layout.R | 140 ++++++++++++------------ R/rewire.R | 28 ++++- R/sgm.R | 22 +++- R/tkplot.R | 8 +- tests/testthat/_snaps/layout.md | 14 ++- tests/testthat/_snaps/rewire.md | 18 +++ tests/testthat/test-centrality.R | 7 +- tests/testthat/test-community.R | 14 +++ tests/testthat/test-constant-defaults.R | 7 +- tests/testthat/test-glet.R | 16 ++- tests/testthat/test-layout.R | 84 ++++++++++---- tests/testthat/test-rewire.R | 7 ++ tests/testthat/test-sgm.R | 18 ++- tools/migrations/community.R | 4 +- tools/migrations/layout.R | 53 +++++---- tools/migrations/motifs-graphlets.R | 8 +- 18 files changed, 328 insertions(+), 160 deletions(-) create mode 100644 tests/testthat/_snaps/rewire.md diff --git a/R/community.R b/R/community.R index a6c0926fb6..ae63d3987f 100644 --- a/R/community.R +++ b/R/community.R @@ -1764,7 +1764,7 @@ cluster_spinglass <- function( #' @param initial_membership If provided, the Leiden algorithm #' will try to improve this provided membership. If no argument is #' provided, the aglorithm simply starts from the singleton partition. -#' @param n_iterations the number of iterations to iterate the Leiden +#' @param n_iter the number of iterations to iterate the Leiden #' algorithm. Each iteration may improve the partition further. #' @param vertex_weights the vertex weights used in the Leiden algorithm. #' If this is not provided, it will be automatically determined on the basis @@ -1811,7 +1811,7 @@ cluster_leiden <- function( resolution = 1, beta = 0.01, initial_membership = NULL, - n_iterations = 2, + n_iter = 2, vertex_weights = NULL ) { # BEGIN GENERATED ARG_HANDLE: cluster_leiden, do not edit, see tools/generate-migrations.R @@ -1830,7 +1830,7 @@ cluster_leiden <- function( if (!base::missing(resolution_parameter)) base::list(resolution = resolution_parameter), if (!base::missing(beta)) base::list(beta = beta), if (!base::missing(initial_membership)) base::list(initial_membership = initial_membership), - if (!base::missing(n_iterations)) base::list(n_iterations = n_iterations), + if (!base::missing(n_iterations)) base::list(n_iter = n_iterations), if (!base::missing(vertex_weights)) base::list(vertex_weights = vertex_weights) ) } @@ -1842,7 +1842,7 @@ cluster_leiden <- function( if (!base::missing(resolution)) "resolution", if (!base::missing(beta)) "beta", if (!base::missing(initial_membership)) "initial_membership", - if (!base::missing(n_iterations)) "n_iterations", + if (!base::missing(n_iter)) "n_iter", if (!base::missing(vertex_weights)) "vertex_weights" )) if (base::length(.arg_conflict) > 0L) cli::cli_abort(base::c("Argument {.arg {(.arg_conflict)}} of {.fn cluster_leiden} was supplied more than once.", i = "Pass it exactly once, by its new name {.arg {(.arg_conflict)}}.")) @@ -1851,7 +1851,7 @@ cluster_leiden <- function( "3.0.0", what = base::I("Calling `cluster_leiden()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: cluster_leiden(", base::paste(base::c("graph", "objective_function", base::c(weights = "weights", resolution = "resolution_parameter", beta = "beta", initial_membership = "initial_membership", n_iterations = "n_iterations", vertex_weights = "vertex_weights")[.arg_names]), collapse = ", "), ")"), + i = base::paste0("Detected call: cluster_leiden(", base::paste(base::c("graph", "objective_function", base::c(weights = "weights", resolution = "resolution_parameter", beta = "beta", initial_membership = "initial_membership", n_iter = "n_iterations", vertex_weights = "vertex_weights")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: cluster_leiden(", base::paste(base::c("graph", "objective_function", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -1900,7 +1900,7 @@ cluster_leiden <- function( } membership <- initial_membership - if (n_iterations > 0) { + if (n_iter > 0) { res <- community_leiden_impl( graph = graph, weights = weights, @@ -1908,7 +1908,7 @@ cluster_leiden <- function( resolution = resolution, beta = beta, start = !is.null(membership), - n_iterations = n_iterations, + n_iterations = n_iter, membership = membership ) diff --git a/R/glet.R b/R/glet.R index 164c82c3aa..86b3f64b2b 100644 --- a/R/glet.R +++ b/R/glet.R @@ -68,7 +68,7 @@ graphlets.candidate.basis <- function(graph, weights = NULL) { #' @param weights Edge weights. If the graph has a `weight` edge attribute #' and this argument is `NULL` (the default), then the `weight` edge #' attribute is used. -#' @param niter Integer scalar, the number of iterations to perform. +#' @param n_iter Integer scalar, the number of iterations to perform. #' @param cliques A list of vertex IDs, the graphlet basis to use for the #' projection. #' @param Mu Starting weights for the projection. The default `NULL` uses a @@ -120,7 +120,7 @@ graphlets.candidate.basis <- function(graph, weights = NULL) { #' plot(g, layout = co) #' #' ## Calculate graphlets -#' gl <- graphlets(g, niter = 1000) +#' gl <- graphlets(g, n_iter = 1000) #' #' ## Plot graphlets #' for (i in seq_along(gl$cliques)) { @@ -191,7 +191,7 @@ graphlet_proj <- function( ..., weights = NULL, cliques, - niter = 1000, + n_iter = 1000, Mu = NULL ) { # BEGIN GENERATED ARG_HANDLE: graphlet_proj, do not edit, see tools/generate-migrations.R @@ -208,7 +208,7 @@ graphlet_proj <- function( base::c( if (!base::missing(weights)) base::list(weights = weights), if (!base::missing(cliques)) base::list(cliques = cliques), - if (!base::missing(niter)) base::list(niter = niter), + if (!base::missing(niter)) base::list(n_iter = niter), if (!base::missing(Mu)) base::list(Mu = Mu) ) } @@ -218,7 +218,7 @@ graphlet_proj <- function( .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(weights)) "weights", if (!base::missing(cliques)) "cliques", - if (!base::missing(niter)) "niter", + if (!base::missing(n_iter)) "n_iter", if (!base::missing(Mu)) "Mu" )) if (base::length(.arg_conflict) > 0L) cli::cli_abort(base::c("Argument {.arg {(.arg_conflict)}} of {.fn graphlet_proj} was supplied more than once.", i = "Pass it exactly once, by its new name {.arg {(.arg_conflict)}}.")) @@ -227,7 +227,7 @@ graphlet_proj <- function( "3.0.0", what = base::I("Calling `graphlet_proj()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: graphlet_proj(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: graphlet_proj(", base::paste(base::c("graph", base::c(weights = "weights", cliques = "cliques", n_iter = "niter", Mu = "Mu")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: graphlet_proj(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -250,14 +250,14 @@ graphlet_proj <- function( weights <- NULL } Mu <- as.numeric(Mu) - niter <- as.numeric(niter) + n_iter <- as.numeric(n_iter) graphlets_project_impl( graph = graph, weights = weights, cliques = cliques, Muc = Mu, - niter = niter + niter = n_iter ) } @@ -320,7 +320,7 @@ graphlets <- function( graph, ..., weights = NULL, - niter = 1000 + n_iter = 1000 ) { # BEGIN GENERATED ARG_HANDLE: graphlets, do not edit, see tools/generate-migrations.R # fmt: skip @@ -335,7 +335,7 @@ graphlets <- function( } base::c( if (!base::missing(weights)) base::list(weights = weights), - if (!base::missing(niter)) base::list(niter = niter) + if (!base::missing(niter)) base::list(n_iter = niter) ) } .arg_handle <- .old_signature(...) @@ -343,7 +343,7 @@ graphlets <- function( .arg_names <- base::names(.arg_handle) .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(weights)) "weights", - if (!base::missing(niter)) "niter" + if (!base::missing(n_iter)) "n_iter" )) if (base::length(.arg_conflict) > 0L) cli::cli_abort(base::c("Argument {.arg {(.arg_conflict)}} of {.fn graphlets} was supplied more than once.", i = "Pass it exactly once, by its new name {.arg {(.arg_conflict)}}.")) base::list2env(.arg_handle, base::environment()) @@ -351,7 +351,7 @@ graphlets <- function( "3.0.0", what = base::I("Calling `graphlets()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: graphlets(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: graphlets(", base::paste(base::c("graph", base::c(weights = "weights", n_iter = "niter")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: graphlets(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -362,6 +362,6 @@ graphlets <- function( graphlets_impl( graph = graph, weights = weights, - niter = niter + niter = n_iter ) } diff --git a/R/layout.R b/R/layout.R index 9d34326df7..07c6ed504a 100644 --- a/R/layout.R +++ b/R/layout.R @@ -696,7 +696,7 @@ normalize <- function( #' @param hgap Real scalar, the minimum horizontal gap between vertices in the #' same layer. #' @param vgap Real scalar, the distance between the two layers. -#' @param maxiter Integer scalar, the maximum number of iterations in the +#' @param max_iter Integer scalar, the maximum number of iterations in the #' crossing minimization stage. 100 is a reasonable default; if you feel that #' you have too many edge crossings, increase this. #' @return A matrix with two columns and as many rows as the number of vertices @@ -726,7 +726,7 @@ layout_as_bipartite <- function( ..., hgap = 1, vgap = 1, - maxiter = 100 + max_iter = 100 ) { # BEGIN GENERATED ARG_HANDLE: layout_as_bipartite, do not edit, see tools/generate-migrations.R # fmt: skip @@ -742,7 +742,7 @@ layout_as_bipartite <- function( base::c( if (!base::missing(hgap)) base::list(hgap = hgap), if (!base::missing(vgap)) base::list(vgap = vgap), - if (!base::missing(maxiter)) base::list(maxiter = maxiter) + if (!base::missing(maxiter)) base::list(max_iter = maxiter) ) } .arg_handle <- .old_signature(...) @@ -751,7 +751,7 @@ layout_as_bipartite <- function( .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(hgap)) "hgap", if (!base::missing(vgap)) "vgap", - if (!base::missing(maxiter)) "maxiter" + if (!base::missing(max_iter)) "max_iter" )) if (base::length(.arg_conflict) > 0L) cli::cli_abort(base::c("Argument {.arg {(.arg_conflict)}} of {.fn layout_as_bipartite} was supplied more than once.", i = "Pass it exactly once, by its new name {.arg {(.arg_conflict)}}.")) base::list2env(.arg_handle, base::environment()) @@ -759,7 +759,7 @@ layout_as_bipartite <- function( "3.0.0", what = base::I("Calling `layout_as_bipartite()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_as_bipartite(", base::paste(base::c("graph", "types", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_as_bipartite(", base::paste(base::c("graph", "types", base::c(hgap = "hgap", vgap = "vgap", max_iter = "maxiter")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_as_bipartite(", base::paste(base::c("graph", "types", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -775,7 +775,7 @@ layout_as_bipartite <- function( types = types, hgap = hgap, vgap = vgap, - maxiter = maxiter + maxiter = max_iter ) } @@ -1566,8 +1566,8 @@ layout.random <- function(..., params = list()) { #' @param coords Optional starting positions for the vertices. If this argument #' is not `NULL` then it should be an appropriate matrix of starting #' coordinates. -#' @param maxiter Number of iterations to perform in the first phase. -#' @param fineiter Number of iterations in the fine tuning phase. The +#' @param n_iter Number of iterations to perform in the first phase. +#' @param n_fine_iter Number of iterations in the fine tuning phase. The #' default `NULL` uses `max(10, log2(vcount(graph)))`. #' @param cool.fact Cooling factor. #' @param weight.node.dist Weight for the node-node distances component of the @@ -1659,8 +1659,8 @@ layout_with_dh <- function( graph, ..., coords = NULL, - maxiter = 10, - fineiter = NULL, + n_iter = 10, + n_fine_iter = NULL, cool.fact = 0.75, weight.node.dist = 1.0, weight.border = 0.0, @@ -1671,7 +1671,7 @@ layout_with_dh <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_dh, do not edit, see tools/generate-migrations.R # fmt: skip if (...length() > 0L) { - .arg_ambiguous <- base::intersect(base::names(base::substitute(...())), base::c("c", "co", "coo", "w", "we", "wei", "weig", "weigh", "weight", "weight.", "weight.n", "weight.no", "weight.nod", "weight.node", "weight.node.", "weight.e", "weight.ed", "weight.edg", "weight.edge", "weight.edge.")) + .arg_ambiguous <- base::intersect(base::names(base::substitute(...())), base::c("c", "co", "coo", "n", "n_", "w", "we", "wei", "weig", "weigh", "weight", "weight.", "weight.n", "weight.no", "weight.nod", "weight.node", "weight.node.", "weight.e", "weight.ed", "weight.edg", "weight.edge", "weight.edge.")) if (base::length(.arg_ambiguous) > 0L) cli::cli_abort("Argument {.arg {(.arg_ambiguous[[1L]])}} matches multiple arguments of {.fn layout_with_dh}.") # Pre-3.0.0 signature: layout_with_dh(graph, coords, maxiter, fineiter, cool.fact, weight.node.dist, weight.border, weight.edge.lengths, weight.edge.crossings, weight.node.edge.dist) .old_signature <- function(coords, maxiter, fineiter, cool.fact, weight.node.dist, weight.border, weight.edge.lengths, weight.edge.crossings, weight.node.edge.dist, ...) { @@ -1683,8 +1683,8 @@ layout_with_dh <- function( } base::c( if (!base::missing(coords)) base::list(coords = coords), - if (!base::missing(maxiter)) base::list(maxiter = maxiter), - if (!base::missing(fineiter)) base::list(fineiter = fineiter), + if (!base::missing(maxiter)) base::list(n_iter = maxiter), + if (!base::missing(fineiter)) base::list(n_fine_iter = fineiter), if (!base::missing(cool.fact)) base::list(cool.fact = cool.fact), if (!base::missing(weight.node.dist)) base::list(weight.node.dist = weight.node.dist), if (!base::missing(weight.border)) base::list(weight.border = weight.border), @@ -1698,8 +1698,8 @@ layout_with_dh <- function( .arg_names <- base::names(.arg_handle) .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(coords)) "coords", - if (!base::missing(maxiter)) "maxiter", - if (!base::missing(fineiter)) "fineiter", + if (!base::missing(n_iter)) "n_iter", + if (!base::missing(n_fine_iter)) "n_fine_iter", if (!base::missing(cool.fact)) "cool.fact", if (!base::missing(weight.node.dist)) "weight.node.dist", if (!base::missing(weight.border)) "weight.border", @@ -1713,7 +1713,7 @@ layout_with_dh <- function( "3.0.0", what = base::I("Calling `layout_with_dh()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_dh(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_dh(", base::paste(base::c("graph", base::c(coords = "coords", n_iter = "maxiter", n_fine_iter = "fineiter", cool.fact = "cool.fact", weight.node.dist = "weight.node.dist", weight.border = "weight.border", weight.edge.lengths = "weight.edge.lengths", weight.edge.crossings = "weight.edge.crossings", weight.node.edge.dist = "weight.node.edge.dist")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_dh(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -1721,8 +1721,8 @@ layout_with_dh <- function( } # END GENERATED ARG_HANDLE - if (is.null(fineiter)) { - fineiter <- max(10, log2(vcount(graph))) + if (is.null(n_fine_iter)) { + n_fine_iter <- max(10, log2(vcount(graph))) } if (is.null(weight.edge.lengths)) { weight.edge.lengths <- edge_density(graph) / 10 @@ -1745,8 +1745,8 @@ layout_with_dh <- function( graph = graph, res = coords, use_seed = use.seed, - maxiter = maxiter, - fineiter = fineiter, + maxiter = n_iter, + fineiter = n_fine_iter, cool_fact = cool.fact, weight_node_dist = weight.node.dist, weight_border = weight.border, @@ -1781,7 +1781,7 @@ with_dh <- function(...) layout_spec(layout_with_dh, ...) #' @param dim Integer scalar, 2 or 3, the dimension of the layout. Two #' dimensional layouts are places on a plane, three dimensional ones in the 3d #' space. -#' @param niter Integer scalar, the number of iterations to perform. +#' @param n_iter Integer scalar, the number of iterations to perform. #' @param start.temp Real scalar, the start temperature. This is the maximum #' amount of movement alloved along one axis, within one step, for a vertex. #' Currently it is decreased linearly to zero during the iteration. The @@ -1849,7 +1849,7 @@ layout_with_fr <- function( ..., coords = NULL, dim = c(2, 3), - niter = 500, + n_iter = 500, start.temp = NULL, grid = c("auto", "grid", "nogrid"), weights = NULL, @@ -1882,7 +1882,7 @@ layout_with_fr <- function( base::c( if (!base::missing(coords)) base::list(coords = coords), if (!base::missing(dim)) base::list(dim = dim), - if (!base::missing(niter)) base::list(niter = niter), + if (!base::missing(niter)) base::list(n_iter = niter), if (!base::missing(start.temp)) base::list(start.temp = start.temp), if (!base::missing(grid)) base::list(grid = grid), if (!base::missing(weights)) base::list(weights = weights), @@ -1896,7 +1896,7 @@ layout_with_fr <- function( if (!base::missing(maxdelta)) base::list(maxdelta = maxdelta), if (!base::missing(area)) base::list(area = area), if (!base::missing(repulserad)) base::list(repulserad = repulserad), - if (!base::missing(maxiter)) base::list(niter = maxiter) + if (!base::missing(maxiter)) base::list(n_iter = maxiter) ) } .arg_handle <- .old_signature(...) @@ -1905,7 +1905,7 @@ layout_with_fr <- function( .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(coords)) "coords", if (!base::missing(dim)) "dim", - if (!base::missing(niter)) "niter", + if (!base::missing(n_iter)) "n_iter", if (!base::missing(start.temp)) "start.temp", if (!base::missing(grid)) "grid", if (!base::missing(weights)) "weights", @@ -1919,7 +1919,7 @@ layout_with_fr <- function( if (!base::missing(maxdelta)) "maxdelta", if (!base::missing(area)) "area", if (!base::missing(repulserad)) "repulserad", - if (!base::missing(niter)) "niter" + if (!base::missing(n_iter)) "n_iter" )) if (base::length(.arg_conflict) > 0L) cli::cli_abort(base::c("Argument {.arg {(.arg_conflict)}} of {.fn layout_with_fr} was supplied more than once.", i = "Pass it exactly once, by its new name {.arg {(.arg_conflict)}}.")) base::list2env(.arg_handle, base::environment()) @@ -1927,7 +1927,7 @@ layout_with_fr <- function( "3.0.0", what = base::I("Calling `layout_with_fr()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_fr(", base::paste(base::c("graph", base::c(coords = "coords", dim = "dim", niter = "niter", start.temp = "start.temp", grid = "grid", weights = "weights", minx = "minx", maxx = "maxx", miny = "miny", maxy = "maxy", minz = "minz", maxz = "maxz", coolexp = "coolexp", maxdelta = "maxdelta", area = "area", repulserad = "repulserad", niter = "maxiter")[.arg_names]), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_fr(", base::paste(base::c("graph", base::c(coords = "coords", dim = "dim", n_iter = "niter", start.temp = "start.temp", grid = "grid", weights = "weights", minx = "minx", maxx = "maxx", miny = "miny", maxy = "maxy", minz = "minz", maxz = "maxz", coolexp = "coolexp", maxdelta = "maxdelta", area = "area", repulserad = "repulserad", n_iter = "maxiter")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_fr(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -1943,7 +1943,7 @@ layout_with_fr <- function( coords[] <- as.numeric(coords) dim <- igraph_match_arg(dim) - niter <- as.numeric(niter) + n_iter <- as.numeric(n_iter) start.temp <- as.numeric(start.temp) grid <- igraph_match_arg(grid) @@ -1994,7 +1994,7 @@ layout_with_fr <- function( Rx_igraph_layout_fruchterman_reingold, graph, coords, - niter, + n_iter, start.temp, weights, minx, @@ -2008,7 +2008,7 @@ layout_with_fr <- function( Rx_igraph_layout_fruchterman_reingold_3d, graph, coords, - niter, + n_iter, start.temp, weights, minx, @@ -2059,14 +2059,14 @@ layout.fruchterman.reingold <- function(..., params = list()) { #' @param coords Starting coordinates in a two or three column matrix, #' depending on the `dim` argument. #' Default: `NULL`. -#' @param maxiter The maximum number of iterations to perform. Updating a +#' @param max_iter The maximum number of iterations to perform. Updating a #' single vertex counts as an iteration. The default `NULL` uses 40 * n * n, #' where n is the number of vertices. The original paper suggests 4 * n * n, #' but this usually only works if the other parameters are set up carefully. #' @param temp.max The maximum allowed local temperature. The default `NULL` #' uses the number of vertices. #' @param temp.min The global temperature at which the algorithm terminates -#' (even before reaching `maxiter` iterations). A reasonable default is +#' (even before reaching `max_iter` iterations). A reasonable default is #' 1/10. #' @param temp.init Initial local temperature of all vertices. The default #' `NULL` uses the square root of the number of vertices. @@ -2092,7 +2092,7 @@ layout_with_gem <- function( graph, ..., coords = NULL, - maxiter = NULL, + max_iter = NULL, temp.max = NULL, temp.min = 0.1, temp.init = NULL @@ -2112,7 +2112,7 @@ layout_with_gem <- function( } base::c( if (!base::missing(coords)) base::list(coords = coords), - if (!base::missing(maxiter)) base::list(maxiter = maxiter), + if (!base::missing(maxiter)) base::list(max_iter = maxiter), if (!base::missing(temp.max)) base::list(temp.max = temp.max), if (!base::missing(temp.min)) base::list(temp.min = temp.min), if (!base::missing(temp.init)) base::list(temp.init = temp.init) @@ -2123,7 +2123,7 @@ layout_with_gem <- function( .arg_names <- base::names(.arg_handle) .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(coords)) "coords", - if (!base::missing(maxiter)) "maxiter", + if (!base::missing(max_iter)) "max_iter", if (!base::missing(temp.max)) "temp.max", if (!base::missing(temp.min)) "temp.min", if (!base::missing(temp.init)) "temp.init" @@ -2134,7 +2134,7 @@ layout_with_gem <- function( "3.0.0", what = base::I("Calling `layout_with_gem()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_gem(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_gem(", base::paste(base::c("graph", base::c(coords = "coords", max_iter = "maxiter", temp.max = "temp.max", temp.min = "temp.min", temp.init = "temp.init")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_gem(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -2142,8 +2142,8 @@ layout_with_gem <- function( } # END GENERATED ARG_HANDLE - if (is.null(maxiter)) { - maxiter <- 40 * vcount(graph)^2 + if (is.null(max_iter)) { + max_iter <- 40 * vcount(graph)^2 } if (is.null(temp.max)) { temp.max <- max(vcount(graph), 1) @@ -2163,7 +2163,7 @@ layout_with_gem <- function( graph = graph, res = coords, use_seed = use.seed, - maxiter = maxiter, + maxiter = max_iter, temp_max = temp.max, temp_min = temp.min, temp_init = temp.init @@ -2198,7 +2198,7 @@ with_gem <- function(...) layout_spec(layout_with_gem, ...) #' @param start If given, then it should be a matrix with two columns and one #' line for each vertex. This matrix will be used as starting positions for the #' algorithm. If not given, then a random starting matrix is used. -#' @param niter Integer scalar, the number of iterations to perform. Should be +#' @param n_iter Integer scalar, the number of iterations to perform. Should be #' a couple of hundred in general. If you have a large graph then you might #' want to only do a few iterations and then check the result. If it is not #' good enough you can feed it in again in the `start` argument. The @@ -2225,7 +2225,7 @@ layout_with_graphopt <- function( graph, ..., start = NULL, - niter = 500, + n_iter = 500, charge = 0.001, mass = 30, spring.length = 0, @@ -2247,7 +2247,7 @@ layout_with_graphopt <- function( } base::c( if (!base::missing(start)) base::list(start = start), - if (!base::missing(niter)) base::list(niter = niter), + if (!base::missing(niter)) base::list(n_iter = niter), if (!base::missing(charge)) base::list(charge = charge), if (!base::missing(mass)) base::list(mass = mass), if (!base::missing(spring.length)) base::list(spring.length = spring.length), @@ -2260,7 +2260,7 @@ layout_with_graphopt <- function( .arg_names <- base::names(.arg_handle) .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(start)) "start", - if (!base::missing(niter)) "niter", + if (!base::missing(n_iter)) "n_iter", if (!base::missing(charge)) "charge", if (!base::missing(mass)) "mass", if (!base::missing(spring.length)) "spring.length", @@ -2273,7 +2273,7 @@ layout_with_graphopt <- function( "3.0.0", what = base::I("Calling `layout_with_graphopt()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_graphopt(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_graphopt(", base::paste(base::c("graph", base::c(start = "start", n_iter = "niter", charge = "charge", mass = "mass", spring.length = "spring.length", spring.constant = "spring.constant", max.sa.movement = "max.sa.movement")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_graphopt(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -2283,7 +2283,7 @@ layout_with_graphopt <- function( ensure_igraph(graph) start[] <- as.numeric(start) - niter <- as.double(niter) + n_iter <- as.double(n_iter) charge <- as.double(charge) mass <- as.double(mass) spring.length <- as.double(spring.length) @@ -2294,7 +2294,7 @@ layout_with_graphopt <- function( .Call( Rx_igraph_layout_graphopt, graph, - niter, + n_iter, charge, mass, spring.length, @@ -2330,12 +2330,12 @@ with_graphopt <- function(...) layout_spec(layout_with_graphopt, ...) #' @param dim Integer scalar, 2 or 3, the dimension of the layout. Two #' dimensional layouts are places on a plane, three dimensional ones in the 3d #' space. -#' @param maxiter The maximum number of iterations to perform. The algorithm +#' @param max_iter The maximum number of iterations to perform. The algorithm #' might terminate earlier, see the `epsilon` argument. The default `NULL` #' uses `50 * vcount(graph)`. #' @param epsilon Numeric scalar, the algorithm terminates, if the maximal #' delta is less than this. (See the reference below for what delta means.) If -#' you set this to zero, then the function always performs `maxiter` +#' you set this to zero, then the function always performs `max_iter` #' iterations. #' @param kkconst Numeric scalar, the Kamada-Kawai vertex attraction constant. #' The default `NULL` uses the number of vertices. @@ -2381,7 +2381,7 @@ layout_with_kk <- function( ..., coords = NULL, dim = c(2, 3), - maxiter = NULL, + max_iter = NULL, epsilon = 0.0, kkconst = NULL, weights = NULL, @@ -2400,7 +2400,7 @@ layout_with_kk <- function( # BEGIN GENERATED ARG_HANDLE: layout_with_kk, do not edit, see tools/generate-migrations.R # fmt: skip if (...length() > 0L) { - .arg_ambiguous <- base::intersect(base::names(base::substitute(...())), base::c("c", "co", "coo", "m", "ma", "max", "mi", "min", "s")) + .arg_ambiguous <- base::intersect(base::names(base::substitute(...())), base::c("m", "ma", "max", "c", "co", "coo", "mi", "min", "s")) if (base::length(.arg_ambiguous) > 0L) cli::cli_abort("Argument {.arg {(.arg_ambiguous[[1L]])}} matches multiple arguments of {.fn layout_with_kk}.") # Pre-3.0.0 signature: layout_with_kk(graph, coords, dim, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy, minz, maxz, niter, sigma, initemp, coolexp, start) .old_signature <- function(coords, dim, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy, minz, maxz, niter, sigma, initemp, coolexp, start, ...) { @@ -2413,7 +2413,7 @@ layout_with_kk <- function( base::c( if (!base::missing(coords)) base::list(coords = coords), if (!base::missing(dim)) base::list(dim = dim), - if (!base::missing(maxiter)) base::list(maxiter = maxiter), + if (!base::missing(maxiter)) base::list(max_iter = maxiter), if (!base::missing(epsilon)) base::list(epsilon = epsilon), if (!base::missing(kkconst)) base::list(kkconst = kkconst), if (!base::missing(weights)) base::list(weights = weights), @@ -2436,7 +2436,7 @@ layout_with_kk <- function( .arg_conflict <- base::intersect(.arg_names, base::c( if (!base::missing(coords)) "coords", if (!base::missing(dim)) "dim", - if (!base::missing(maxiter)) "maxiter", + if (!base::missing(max_iter)) "max_iter", if (!base::missing(epsilon)) "epsilon", if (!base::missing(kkconst)) "kkconst", if (!base::missing(weights)) "weights", @@ -2458,7 +2458,7 @@ layout_with_kk <- function( "3.0.0", what = base::I("Calling `layout_with_kk()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_kk(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_kk(", base::paste(base::c("graph", base::c(coords = "coords", dim = "dim", max_iter = "maxiter", epsilon = "epsilon", kkconst = "kkconst", weights = "weights", minx = "minx", maxx = "maxx", miny = "miny", maxy = "maxy", minz = "minz", maxz = "maxz", niter = "niter", sigma = "sigma", initemp = "initemp", coolexp = "coolexp", start = "start")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_kk(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -2466,8 +2466,8 @@ layout_with_kk <- function( } # END GENERATED ARG_HANDLE - if (is.null(maxiter)) { - maxiter <- 50 * vcount(graph) + if (is.null(max_iter)) { + max_iter <- 50 * vcount(graph) } if (is.null(kkconst)) { kkconst <- max(vcount(graph), 1) @@ -2493,7 +2493,7 @@ layout_with_kk <- function( coords[] <- as.numeric(coords) dim <- igraph_match_arg(dim) - maxiter <- as.numeric(maxiter) + max_iter <- as.numeric(max_iter) epsilon <- as.numeric(epsilon) kkconst <- as.numeric(kkconst) if (is.null(weights) && "weight" %in% edge_attr_names(graph)) { @@ -2543,7 +2543,7 @@ layout_with_kk <- function( Rx_igraph_layout_kamada_kawai, graph, coords, - maxiter, + max_iter, epsilon, kkconst, weights, @@ -2557,7 +2557,7 @@ layout_with_kk <- function( Rx_igraph_layout_kamada_kawai_3d, graph, coords, - maxiter, + max_iter, epsilon, kkconst, weights, @@ -2609,7 +2609,7 @@ layout.kamada.kawai <- function(..., params = list()) { #' #' @param graph The input graph #' @inheritParams rlang::args_dots_empty -#' @param maxiter The maximum number of iterations to perform (150). +#' @param max_iter The maximum number of iterations to perform (150). #' @param maxdelta The maximum change for a vertex during an iteration. The #' default `NULL` uses the number of vertices. #' @param area The area of the surface on which the vertices are placed. The @@ -2633,7 +2633,7 @@ layout.kamada.kawai <- function(..., params = list()) { layout_with_lgl <- function( graph, ..., - maxiter = 150, + max_iter = 150, maxdelta = NULL, area = NULL, coolexp = 1.5, @@ -2655,7 +2655,7 @@ layout_with_lgl <- function( cli::cli_abort(base::c("Unexpected argument passed to {.fn layout_with_lgl}: {.arg {(.arg_extra)}}.", i = "Arguments after {.arg ...} must be spelled out in full."), call = base::parent.frame()) } base::c( - if (!base::missing(maxiter)) base::list(maxiter = maxiter), + if (!base::missing(maxiter)) base::list(max_iter = maxiter), if (!base::missing(maxdelta)) base::list(maxdelta = maxdelta), if (!base::missing(area)) base::list(area = area), if (!base::missing(coolexp)) base::list(coolexp = coolexp), @@ -2668,7 +2668,7 @@ layout_with_lgl <- function( if (base::length(.arg_handle) > 0L) { .arg_names <- base::names(.arg_handle) .arg_conflict <- base::intersect(.arg_names, base::c( - if (!base::missing(maxiter)) "maxiter", + if (!base::missing(max_iter)) "max_iter", if (!base::missing(maxdelta)) "maxdelta", if (!base::missing(area)) "area", if (!base::missing(coolexp)) "coolexp", @@ -2682,7 +2682,7 @@ layout_with_lgl <- function( "3.0.0", what = base::I("Calling `layout_with_lgl()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_lgl(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_lgl(", base::paste(base::c("graph", base::c(max_iter = "maxiter", maxdelta = "maxdelta", area = "area", coolexp = "coolexp", repulserad = "repulserad", cellsize = "cellsize", root = "root")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_lgl(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -2714,7 +2714,7 @@ layout_with_lgl <- function( .Call( Rx_igraph_layout_lgl, graph, - as.double(maxiter), + as.double(max_iter), as.double(maxdelta), as.double(area), as.double(coolexp), @@ -2849,7 +2849,7 @@ with_mds <- function(...) layout_spec(layout_with_mds, ...) #' @param hgap Real scalar, the minimum horizontal gap between vertices in the #' same layer. #' @param vgap Real scalar, the distance between layers. -#' @param maxiter Integer scalar, the maximum number of iterations in the +#' @param max_iter Integer scalar, the maximum number of iterations in the #' crossing minimization stage. 100 is a reasonable default; if you feel that #' you have too many edge crossings, increase this. #' @param weights Optional edge weight vector. If `NULL`, then the @@ -3035,7 +3035,7 @@ layout_with_sugiyama <- function( layers = NULL, hgap = 1, vgap = 1, - maxiter = 100, + max_iter = 100, weights = NULL, attributes = c("default", "all", "none") ) { @@ -3054,7 +3054,7 @@ layout_with_sugiyama <- function( if (!base::missing(layers)) base::list(layers = layers), if (!base::missing(hgap)) base::list(hgap = hgap), if (!base::missing(vgap)) base::list(vgap = vgap), - if (!base::missing(maxiter)) base::list(maxiter = maxiter), + if (!base::missing(maxiter)) base::list(max_iter = maxiter), if (!base::missing(weights)) base::list(weights = weights), if (!base::missing(attributes)) base::list(attributes = attributes) ) @@ -3066,7 +3066,7 @@ layout_with_sugiyama <- function( if (!base::missing(layers)) "layers", if (!base::missing(hgap)) "hgap", if (!base::missing(vgap)) "vgap", - if (!base::missing(maxiter)) "maxiter", + if (!base::missing(max_iter)) "max_iter", if (!base::missing(weights)) "weights", if (!base::missing(attributes)) "attributes" )) @@ -3076,7 +3076,7 @@ layout_with_sugiyama <- function( "3.0.0", what = base::I("Calling `layout_with_sugiyama()` with positional or abbreviated arguments"), details = base::c( - i = base::paste0("Detected call: layout_with_sugiyama(", base::paste(base::c("graph", .arg_names), collapse = ", "), ")"), + i = base::paste0("Detected call: layout_with_sugiyama(", base::paste(base::c("graph", base::c(layers = "layers", hgap = "hgap", vgap = "vgap", max_iter = "maxiter", weights = "weights", attributes = "attributes")[.arg_names]), collapse = ", "), ")"), i = base::paste0("Use instead: layout_with_sugiyama(", base::paste(base::c("graph", base::paste0(.arg_names, " = ")), collapse = ", "), ")") ) ) @@ -3091,7 +3091,7 @@ layout_with_sugiyama <- function( layers = layers, hgap = hgap, vgap = vgap, - maxiter = maxiter, + maxiter = max_iter, weights = weights ) diff --git a/R/rewire.R b/R/rewire.R index 775e449d68..e14ca1783a 100644 --- a/R/rewire.R +++ b/R/rewire.R @@ -37,7 +37,7 @@ #' g %>% #' rewire(each_edge(p = 0.1, loops = FALSE)) %>% #' plot(layout = layout_in_circle) -#' print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10))) +#' print_all(rewire(g, with = keeping_degseq(n_iter = vcount(g) * 10))) rewire <- function(graph, with) { if (!is(with, "igraph_rewiring_method")) { cli::cli_abort( @@ -60,7 +60,8 @@ rewire <- function(graph, with) { #' edges. #' #' @param loops Whether to allow destroying and creating loop edges. -#' @param niter Number of rewiring trials to perform. +#' @param n_iter Number of rewiring trials to perform. +#' @param niter `r lifecycle::badge("deprecated")` Use `n_iter` instead. #' #' @author Tamas Nepusz \email{ntamas@@gmail.com} and Gabor Csardi #' \email{csardi.gabor@@gmail.com} @@ -71,13 +72,28 @@ rewire <- function(graph, with) { #' @examples #' g <- make_ring(10) #' g %>% -#' rewire(keeping_degseq(niter = 20)) %>% +#' rewire(keeping_degseq(n_iter = 20)) %>% #' degree() -#' print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10))) -keeping_degseq <- function(loops = FALSE, niter = 100) { +#' print_all(rewire(g, with = keeping_degseq(n_iter = vcount(g) * 10))) +keeping_degseq <- function(loops = FALSE, n_iter = 100, niter = deprecated()) { + if (lifecycle::is_present(niter)) { + if (!missing(n_iter)) { + cli::cli_abort(c( + "Argument {.arg n_iter} of {.fn keeping_degseq} was supplied more than once.", + i = "It was also supplied via its legacy name {.arg niter}." + )) + } + lifecycle::deprecate_soft( + "3.0.0", + "keeping_degseq(niter = )", + "keeping_degseq(n_iter = )" + ) + n_iter <- niter + } + method <- list( fun = rewire_keeping_degseq, - args = list(loops = loops, niter = niter) + args = list(loops = loops, niter = n_iter) ) add_class(method, "igraph_rewiring_method") } diff --git a/R/sgm.R b/R/sgm.R index 29e6cf9345..ba004f7f25 100644 --- a/R/sgm.R +++ b/R/sgm.R @@ -65,7 +65,8 @@ solve_LSAP <- function(x, maximum = FALSE) { #' matched. #' @param start a numeric matrix, the permutation matrix estimate is #' initialized with `start` -#' @param iteration The number of iterations for the Frank-Wolfe algorithm +#' @param max_iter The number of iterations for the Frank-Wolfe algorithm +#' @param iteration `r lifecycle::badge("deprecated")` Use `max_iter` instead. #' @return A numeric matrix which is the permutation matrix that determines the #' bijection between the graphs of `A` and `B` #' @author Vince Lyzinski @@ -91,7 +92,22 @@ solve_LSAP <- function(x, maximum = FALSE) { #' P #' @family sgm #' @export -match_vertices <- function(A, B, m, start, iteration) { +match_vertices <- function(A, B, m, start, max_iter, iteration = deprecated()) { + if (lifecycle::is_present(iteration)) { + if (!missing(max_iter)) { + cli::cli_abort(c( + "Argument {.arg max_iter} of {.fn match_vertices} was supplied more than once.", + i = "It was also supplied via its legacy name {.arg iteration}." + )) + } + lifecycle::deprecate_soft( + "3.0.0", + "match_vertices(iteration = )", + "match_vertices(max_iter = )" + ) + max_iter <- iteration + } + ## Seeds are assumed to be vertices 1:m in both graphs totv <- ncol(A) n <- totv - m @@ -109,7 +125,7 @@ match_vertices <- function(A, B, m, start, iteration) { } A22 <- A[(m + 1):(m + n), (m + 1):(m + n)] B22 <- B[(m + 1):(m + n), (m + 1):(m + n)] - patience <- iteration + patience <- max_iter tol <- 1 P <- start toggle <- 1 diff --git a/R/tkplot.R b/R/tkplot.R index dbb30c6020..0731bb0743 100644 --- a/R/tkplot.R +++ b/R/tkplot.R @@ -392,7 +392,7 @@ tkplot <- function(graph, canvas.width = 450, canvas.height = 450, ...) { name = "Fruchterman-Reingold", f = layout_with_fr, params = list( - niter = list( + n_iter = list( name = "Number of iterations", type = "numeric", default = 500 @@ -411,7 +411,7 @@ tkplot <- function(graph, canvas.width = 450, canvas.height = 450, ...) { name = "Kamada-Kawai", f = layout_with_kk, params = list( - maxiter = list( + max_iter = list( name = "Maximum number of iterations", type = "expression", default = expression(50 * vcount(.tkplot.g)) @@ -445,12 +445,12 @@ tkplot <- function(graph, canvas.width = 450, canvas.height = 450, ...) { name = "Davidson-Harel", f = layout_with_dh, params = list( - maxiter = list( + n_iter = list( name = "Maximum iterations", type = "numeric", default = 10 ), - fineiter = list( + n_fine_iter = list( name = "Fine-tuning iterations", type = "expression", default = expression(max(10, log2(vcount(.tkplot.g)))) diff --git a/tests/testthat/_snaps/layout.md b/tests/testthat/_snaps/layout.md index 599ec67c5e..3757f21373 100644 --- a/tests/testthat/_snaps/layout.md +++ b/tests/testthat/_snaps/layout.md @@ -1,7 +1,7 @@ # layout_with_fr() deprecated argument Code - l <- layout_with_fr(g, niter = 50, start.temp = sqrt(10) / 10, coolexp = 1, + l <- layout_with_fr(g, n_iter = 50, start.temp = sqrt(10) / 10, coolexp = 1, maxdelta = 1, area = 1, repulserad = 1) Condition Error: @@ -10,7 +10,7 @@ # layout_with_kk() deprecated arguments Code - l <- layout_with_kk(g, maxiter = 50, coords = layout_in_circle(g), niter = 1, + l <- layout_with_kk(g, max_iter = 50, coords = layout_in_circle(g), niter = 1, sigma = 1, initemp = 1, coolexp = 1) Condition Error: @@ -32,3 +32,13 @@ Error in `layout_randomly()`: ! `dim` must be one of "2" or "3", not "4". +# legacy iteration argument names are deprecated but still work + + Code + res <- layout_with_fr(g, coords = coords, niter = 20) + Condition + Warning: + Calling `layout_with_fr()` with positional or abbreviated arguments was deprecated in igraph 3.0.0. + i Detected call: layout_with_fr(graph, niter) + i Use instead: layout_with_fr(graph, n_iter = ) + diff --git a/tests/testthat/_snaps/rewire.md b/tests/testthat/_snaps/rewire.md new file mode 100644 index 0000000000..c886e2a4ce --- /dev/null +++ b/tests/testthat/_snaps/rewire.md @@ -0,0 +1,18 @@ +# keeping_degseq(niter = ) is deprecated but still works + + Code + res <- keeping_degseq(niter = 20) + Condition + Warning: + The `niter` argument of `keeping_degseq()` is deprecated as of igraph 3.0.0. + i Please use the `n_iter` argument instead. + +--- + + Code + keeping_degseq(n_iter = 20, niter = 10) + Condition + Error in `keeping_degseq()`: + ! Argument `n_iter` of `keeping_degseq()` was supplied more than once. + i It was also supplied via its legacy name `niter`. + diff --git a/tests/testthat/test-centrality.R b/tests/testthat/test-centrality.R index 9330f768c3..30ccc0b138 100644 --- a/tests/testthat/test-centrality.R +++ b/tests/testthat/test-centrality.R @@ -1039,7 +1039,12 @@ test_that("edge_betweenness() covers migrated tail args and positional recovery" expect_equal(res, rep(3, 3)) # With a cutoff of 1 each edge only carries the path of its endpoints. expect_equal( - edge_betweenness(ring, edges = E(ring)[1:3], weights = rep(1, 5), cutoff = 1), + edge_betweenness( + ring, + edges = E(ring)[1:3], + weights = rep(1, 5), + cutoff = 1 + ), rep(1, 3) ) diff --git a/tests/testthat/test-community.R b/tests/testthat/test-community.R index cafe7adfa7..0b4e7cace0 100644 --- a/tests/testthat/test-community.R +++ b/tests/testthat/test-community.R @@ -1012,3 +1012,17 @@ test_that("modularity_matrix() covers migrated tail args and positional recovery modularity_matrix(karate, rep(1, vcount(karate)), rep(1, ecount(karate))) }) }) + +test_that("cluster_leiden(n_iterations = ) is deprecated but still works", { + rlang::local_options(lifecycle_verbosity = "warning") + g <- make_graph("Zachary") + igraph_local_seed(42) + lifecycle::expect_deprecated( + res <- cluster_leiden(g, "modularity", n_iterations = 3) + ) + igraph_local_seed(42) + expect_equal( + membership(res), + membership(cluster_leiden(g, "modularity", n_iter = 3)) + ) +}) diff --git a/tests/testthat/test-constant-defaults.R b/tests/testthat/test-constant-defaults.R index 6699870ba1..b5cd4ef03a 100644 --- a/tests/testthat/test-constant-defaults.R +++ b/tests/testthat/test-constant-defaults.R @@ -43,7 +43,10 @@ test_that("NULL selector defaults of round-2 functions select the full set", { expect_identical_graphs(reverse_edges(g, edges = NULL), reverse_edges(g)) V(g)$name <- letters[1:5] - expect_identical(vertex_attr(g, "name", vertices = NULL), vertex_attr(g, "name")) + expect_identical( + vertex_attr(g, "name", vertices = NULL), + vertex_attr(g, "name") + ) expect_identical(vertex.attributes(g, index = NULL), vertex.attributes(g)) g2 <- set_vertex_attr(g, "x", vertices = NULL, value = 1) expect_identical(vertex_attr(g2, "x"), rep(1, 5)) @@ -70,7 +73,7 @@ test_that("NULL non-selector defaults of round-2 functions resolve in the body", expect_identical_graphs(g1, g2) igraph_local_seed(1) - l1 <- layout_with_kk(g, kkconst = NULL, maxiter = NULL) + l1 <- layout_with_kk(g, kkconst = NULL, max_iter = NULL) igraph_local_seed(1) l2 <- layout_with_kk(g) expect_identical(l1, l2) diff --git a/tests/testthat/test-glet.R b/tests/testthat/test-glet.R index af039389da..88013c3dbb 100644 --- a/tests/testthat/test-glet.R +++ b/tests/testthat/test-glet.R @@ -126,7 +126,7 @@ test_that("graphlet_proj() covers all tail arguments", { g, weights = E(g)$weight, cliques = cl, - niter = 100, + n_iter = 100, Mu = rep(2, length(cl)) ) expect_type(res, "double") @@ -148,7 +148,7 @@ test_that("graphlets() covers all tail arguments", { w <- rep(1, ecount(g)) # Uniform weights collapse the basis to the two maximal cliques. - res <- graphlets(g, weights = w, niter = 50) + res <- graphlets(g, weights = w, n_iter = 50) expect_named(res, c("cliques", "Mu")) expect_length(res$cliques, 2) expect_length(res$Mu, length(res$cliques)) @@ -159,3 +159,15 @@ test_that("graphlets() covers all tail arguments", { ) expect_identical(res_legacy, graphlets(g, weights = w)) }) + +test_that("graphlets(niter = ) and graphlet_proj(niter = ) are deprecated but still work", { + rlang::local_options(lifecycle_verbosity = "warning") + g <- make_graphlet_graph() + cl <- graphlet_basis(g)$cliques + lifecycle::expect_deprecated(res <- graphlets(g, niter = 50)) + expect_equal(res, graphlets(g, n_iter = 50)) + lifecycle::expect_deprecated( + res <- graphlet_proj(g, cliques = cl, niter = 50) + ) + expect_equal(res, graphlet_proj(g, cliques = cl, n_iter = 50)) +}) diff --git a/tests/testthat/test-layout.R b/tests/testthat/test-layout.R index 5e66612b81..35d74eac36 100644 --- a/tests/testthat/test-layout.R +++ b/tests/testthat/test-layout.R @@ -3,13 +3,13 @@ test_that("layout_with_fr() works", { igraph_with_seed(42, { g <- make_ring(10) - l <- layout_with_fr(g, niter = 50, start.temp = sqrt(10) / 10) + l <- layout_with_fr(g, n_iter = 50, start.temp = sqrt(10) / 10) }) expect_equal(sum(l), 4.57228, tolerance = 0.1) igraph_with_seed(42, { g <- make_star(30) - l <- layout_with_fr(g, niter = 500, dim = 3, start.temp = 20) + l <- layout_with_fr(g, n_iter = 500, dim = 3, start.temp = 20) }) expect_equal(sum(l), -170.9312, tolerance = 0.1) }) @@ -20,7 +20,7 @@ test_that("layout_with_fr() deprecated argument", { expect_snapshot_igraph_error({ l <- layout_with_fr( g, - niter = 50, + n_iter = 50, start.temp = sqrt(10) / 10, coolexp = 1, maxdelta = 1, @@ -197,20 +197,20 @@ test_that("Kamada-Kawai layout generator works", { } g <- make_ring(10) - l <- layout_with_kk(g, maxiter = 50, coords = layout_in_circle(g)) + l <- layout_with_kk(g, max_iter = 50, coords = layout_in_circle(g)) expect_true(looks_circular(l)) g <- make_star(12) - l <- layout_with_kk(g, maxiter = 500, coords = layout_in_circle(g)) + l <- layout_with_kk(g, max_iter = 500, coords = layout_in_circle(g)) expect_true(looks_circular(l[-1, ])) g <- make_ring(10) E(g)$weight <- rep(1:2, length.out = ecount(g)) - l <- layout_with_kk(g, maxiter = 500, coords = layout_in_circle(g)) + l <- layout_with_kk(g, max_iter = 500, coords = layout_in_circle(g)) expect_true(looks_circular(l, check_dists = FALSE)) g <- make_star(30) - l <- layout_with_kk(g, maxiter = 5000, dim = 3) + l <- layout_with_kk(g, max_iter = 5000, dim = 3) expect_true(looks_circular(l[-1, ], check_dists = FALSE, eps = 1e-2)) }) @@ -219,7 +219,7 @@ test_that("layout_with_kk() deprecated arguments", { expect_snapshot_igraph_error({ l <- layout_with_kk( g, - maxiter = 50, + max_iter = 50, coords = layout_in_circle(g), niter = 1, sigma = 1, @@ -512,7 +512,7 @@ test_that("layout_as_bipartite() covers tail args and recovers positional calls" g <- make_full_bipartite_graph(3, 2) # All tail arguments by name. - l <- layout_as_bipartite(g, V(g)$type, hgap = 3, vgap = 2, maxiter = 50) + l <- layout_as_bipartite(g, V(g)$type, hgap = 3, vgap = 2, max_iter = 50) expect_equal(dim(l), c(5, 2)) # The two vertex types end up on rows vgap apart. expect_equal(sort(unique(l[, 2])), c(0, 2)) @@ -635,8 +635,8 @@ test_that("layout_with_dh() covers tail args and recovers positional calls", { l <- layout_with_dh( g, coords = coords, - maxiter = 5, - fineiter = 5, + n_iter = 5, + n_fine_iter = 5, cool.fact = 0.5, weight.node.dist = 2, weight.border = 0.1, @@ -653,7 +653,7 @@ test_that("layout_with_dh() covers tail args and recovers positional calls", { lifecycle::expect_deprecated(res <- layout_with_dh(g, coords, maxiter = 5)) }) igraph_with_seed(1, { - ref <- layout_with_dh(g, coords = coords, maxiter = 5) + ref <- layout_with_dh(g, coords = coords, n_iter = 5) }) expect_identical(res, ref) }) @@ -714,7 +714,7 @@ test_that("layout_with_fr() covers the remaining tail args and recovery", { l <- layout_with_fr( g, coords = coords, - niter = 20, + n_iter = 20, grid = "nogrid", weights = rep(0.5, ecount(g)), minx = rep(-3, 10), @@ -732,7 +732,7 @@ test_that("layout_with_fr() covers the remaining tail args and recovery", { l3 <- layout_with_fr( g, dim = 3, - niter = 20, + n_iter = 20, minz = rep(-2, 10), maxz = rep(2, 10) ) @@ -745,7 +745,7 @@ test_that("layout_with_fr() covers the remaining tail args and recovery", { lifecycle::expect_deprecated(res <- layout_with_fr(g, coords, niter = 20)) }) igraph_with_seed(1, { - ref <- layout_with_fr(g, coords = coords, niter = 20) + ref <- layout_with_fr(g, coords = coords, n_iter = 20) }) expect_identical(res, ref) }) @@ -759,7 +759,7 @@ test_that("layout_with_gem() covers tail args and recovers positional calls", { l <- layout_with_gem( g, coords = coords, - maxiter = 100, + max_iter = 100, temp.max = 5, temp.min = 0.5, temp.init = 2 @@ -787,7 +787,7 @@ test_that("layout_with_graphopt() covers tail args and recovers positional calls l <- layout_with_graphopt( g, start = start, - niter = 50, + n_iter = 50, charge = 0.01, mass = 10, spring.length = 1, @@ -817,7 +817,7 @@ test_that("layout_with_kk() covers the remaining tail args and recovery", { l <- layout_with_kk( g, coords = coords, - maxiter = 50, + max_iter = 50, epsilon = 1e-3, kkconst = 5, weights = rep(2, ecount(g)), @@ -835,7 +835,7 @@ test_that("layout_with_kk() covers the remaining tail args and recovery", { l3 <- layout_with_kk( g, dim = 3, - maxiter = 50, + max_iter = 50, minz = rep(0, 10), maxz = rep(1, 10) ) @@ -845,7 +845,7 @@ test_that("layout_with_kk() covers the remaining tail args and recovery", { # The legacy positional call recovers coords and warns. lifecycle::expect_deprecated(res <- layout_with_kk(g, coords, maxiter = 50)) - expect_identical(res, layout_with_kk(g, coords = coords, maxiter = 50)) + expect_identical(res, layout_with_kk(g, coords = coords, max_iter = 50)) }) test_that("layout_with_lgl() covers tail args and recovers positional calls", { @@ -855,7 +855,7 @@ test_that("layout_with_lgl() covers tail args and recovers positional calls", { igraph_with_seed(42, { l <- layout_with_lgl( g, - maxiter = 50, + max_iter = 50, maxdelta = 5, area = 64, coolexp = 1.2, @@ -872,7 +872,7 @@ test_that("layout_with_lgl() covers tail args and recovers positional calls", { lifecycle::expect_deprecated(res <- layout_with_lgl(g, 50)) }) igraph_with_seed(1, { - ref <- layout_with_lgl(g, maxiter = 50) + ref <- layout_with_lgl(g, max_iter = 50) }) expect_identical(res, ref) }) @@ -887,7 +887,7 @@ test_that("layout_with_sugiyama() covers tail args and recovers positional calls layers = c(1, 2, 3, 4), hgap = 2, vgap = 2, - maxiter = 50, + max_iter = 50, weights = rep(1, ecount(g)), attributes = "all" ) @@ -945,3 +945,41 @@ test_that("norm_coords() recovers positional calls", { # xmin = 0 rescales the first column into [0, 1]. expect_equal(range(res[, 1]), c(0, 1)) }) + +test_that("legacy iteration argument names are deprecated but still work", { + rlang::local_options(lifecycle_verbosity = "warning") + g <- make_ring(10) + coords <- layout_in_circle(g) + + igraph_local_seed(42) + expect_snapshot_igraph(res <- layout_with_fr(g, coords = coords, niter = 20)) + igraph_local_seed(42) + expect_equal(res, layout_with_fr(g, coords = coords, n_iter = 20)) + # `maxiter` was an alias of `niter`, it now also maps to `n_iter` + igraph_local_seed(42) + lifecycle::expect_deprecated( + res <- layout_with_fr(g, coords = coords, maxiter = 20) + ) + igraph_local_seed(42) + expect_equal(res, layout_with_fr(g, coords = coords, n_iter = 20)) + + lifecycle::expect_deprecated( + res <- layout_with_kk(g, coords = coords, maxiter = 50) + ) + expect_equal(res, layout_with_kk(g, coords = coords, max_iter = 50)) + + igraph_local_seed(42) + lifecycle::expect_deprecated( + res <- layout_with_dh(g, coords = coords, maxiter = 5, fineiter = 5) + ) + igraph_local_seed(42) + expect_equal( + res, + layout_with_dh(g, coords = coords, n_iter = 5, n_fine_iter = 5) + ) + + igraph_local_seed(42) + lifecycle::expect_deprecated(res <- layout_with_graphopt(g, niter = 50)) + igraph_local_seed(42) + expect_equal(res, layout_with_graphopt(g, n_iter = 50)) +}) diff --git a/tests/testthat/test-rewire.R b/tests/testthat/test-rewire.R index 4382025e8c..8a9a60a50c 100644 --- a/tests/testthat/test-rewire.R +++ b/tests/testthat/test-rewire.R @@ -52,3 +52,10 @@ test_that("each_edge() recovers legacy positional arguments", { ) expect_identical(res, each_edge(0.3, loops = TRUE)) }) + +test_that("keeping_degseq(niter = ) is deprecated but still works", { + rlang::local_options(lifecycle_verbosity = "warning") + expect_snapshot_igraph(res <- keeping_degseq(niter = 20)) + expect_equal(res, keeping_degseq(n_iter = 20)) + expect_snapshot_igraph_error(keeping_degseq(n_iter = 20, niter = 10)) +}) diff --git a/tests/testthat/test-sgm.R b/tests/testthat/test-sgm.R index 64363db1b9..0dfc53db74 100644 --- a/tests/testthat/test-sgm.R +++ b/tests/testthat/test-sgm.R @@ -12,7 +12,7 @@ test_that("SGM works", { g2[], m = nos, start = matrix(1 / (vc - nos), vc - nos, vc - nos), - iteration = 20 + max_iter = 20 ) expect_equal(c(1:nos, P$corr[, 2]), randperm) @@ -37,7 +37,7 @@ test_that("SGM works", { g2[], m = nos, start = matrix(1 / (vc - nos), vc - nos, vc - nos), - iteration = 20 + max_iter = 20 ) expect_equal(P$corr[, 2], perm[(nos + 1):vc]) @@ -54,3 +54,17 @@ test_that("LSAP does not change input matrix", { expect_equal(x, matrix(c(5, 1, 4, 3, 5, 2, 2, 4, 4), nrow = 3)) }) + +test_that("match_vertices(iteration = ) is deprecated but still works", { + rlang::local_options(lifecycle_verbosity = "warning") + igraph_local_seed(42) + g1 <- sample_gnp(10, 0.5) + start <- matrix(1 / 7, 7, 7) + lifecycle::expect_deprecated( + res <- match_vertices(g1[], g1[], m = 3, start = start, iteration = 5) + ) + expect_equal( + res, + match_vertices(g1[], g1[], m = 3, start = start, max_iter = 5) + ) +}) diff --git a/tools/migrations/community.R b/tools/migrations/community.R index 7ab162ce94..acd27e1e61 100644 --- a/tools/migrations/community.R +++ b/tools/migrations/community.R @@ -68,7 +68,7 @@ migrations <- list( resolution_parameter = resolution, beta, initial_membership, - n_iterations, + n_iterations = n_iter, vertex_weights ) {}, new = function( @@ -79,7 +79,7 @@ migrations <- list( resolution = 1, beta = 0.01, initial_membership = NULL, - n_iterations = 2, + n_iter = 2, vertex_weights = NULL ) {}, when = "3.0.0" diff --git a/tools/migrations/layout.R b/tools/migrations/layout.R index fd76e22495..b29ada90b1 100644 --- a/tools/migrations/layout.R +++ b/tools/migrations/layout.R @@ -4,14 +4,14 @@ migrations <- list( layout_as_bipartite = list( - old = function(graph, types, hgap, vgap, maxiter) {}, + old = function(graph, types, hgap, vgap, maxiter = max_iter) {}, new = function( graph, types = NULL, ..., hgap = 1, vgap = 1, - maxiter = 100 + max_iter = 100 ) {}, when = "3.0.0" ), @@ -67,8 +67,8 @@ migrations <- list( old = function( graph, coords, - maxiter, - fineiter, + maxiter = n_iter, + fineiter = n_fine_iter, cool.fact, weight.node.dist, weight.border, @@ -80,8 +80,8 @@ migrations <- list( graph, ..., coords = NULL, - maxiter = 10, - fineiter = NULL, + n_iter = 10, + n_fine_iter = NULL, cool.fact = 0.75, weight.node.dist = 1.0, weight.border = 0.0, @@ -111,7 +111,7 @@ migrations <- list( graph, coords, dim, - niter, + niter = n_iter, start.temp, grid, weights, @@ -125,14 +125,14 @@ migrations <- list( maxdelta, area, repulserad, - maxiter = niter + maxiter = n_iter ) {}, new = function( graph, ..., coords = NULL, dim = c(2, 3), - niter = 500, + n_iter = 500, start.temp = NULL, grid = c("auto", "grid", "nogrid"), weights = NULL, @@ -151,12 +151,19 @@ migrations <- list( ), layout_with_gem = list( - old = function(graph, coords, maxiter, temp.max, temp.min, temp.init) {}, + old = function( + graph, + coords, + maxiter = max_iter, + temp.max, + temp.min, + temp.init + ) {}, new = function( graph, ..., coords = NULL, - maxiter = NULL, + max_iter = NULL, temp.max = NULL, temp.min = 0.1, temp.init = NULL @@ -168,7 +175,7 @@ migrations <- list( old = function( graph, start, - niter, + niter = n_iter, charge, mass, spring.length, @@ -179,7 +186,7 @@ migrations <- list( graph, ..., start = NULL, - niter = 500, + n_iter = 500, charge = 0.001, mass = 30, spring.length = 0, @@ -194,7 +201,7 @@ migrations <- list( graph, coords, dim, - maxiter, + maxiter = max_iter, epsilon, kkconst, weights, @@ -215,7 +222,7 @@ migrations <- list( ..., coords = NULL, dim = c(2, 3), - maxiter = NULL, + max_iter = NULL, epsilon = 0.0, kkconst = NULL, weights = NULL, @@ -237,7 +244,7 @@ migrations <- list( layout_with_lgl = list( old = function( graph, - maxiter, + maxiter = max_iter, maxdelta, area, coolexp, @@ -248,7 +255,7 @@ migrations <- list( new = function( graph, ..., - maxiter = 150, + max_iter = 150, maxdelta = NULL, area = NULL, coolexp = 1.5, @@ -260,14 +267,22 @@ migrations <- list( ), layout_with_sugiyama = list( - old = function(graph, layers, hgap, vgap, maxiter, weights, attributes) {}, + old = function( + graph, + layers, + hgap, + vgap, + maxiter = max_iter, + weights, + attributes + ) {}, new = function( graph, ..., layers = NULL, hgap = 1, vgap = 1, - maxiter = 100, + max_iter = 100, weights = NULL, attributes = c("default", "all", "none") ) {}, diff --git a/tools/migrations/motifs-graphlets.R b/tools/migrations/motifs-graphlets.R index 7bf83db155..856bf28471 100644 --- a/tools/migrations/motifs-graphlets.R +++ b/tools/migrations/motifs-graphlets.R @@ -14,25 +14,25 @@ migrations <- list( ), graphlet_proj = list( - old = function(graph, weights, cliques, niter, Mu) {}, + old = function(graph, weights, cliques, niter = n_iter, Mu) {}, new = function( graph, ..., weights = NULL, cliques, - niter = 1000, + n_iter = 1000, Mu = NULL ) {}, when = "3.0.0" ), graphlets = list( - old = function(graph, weights, niter) {}, + old = function(graph, weights, niter = n_iter) {}, new = function( graph, ..., weights = NULL, - niter = 1000 + n_iter = 1000 ) {}, when = "3.0.0" ), From 42e470f6ea66f268539b43b9ac378e5066d7a7e5 Mon Sep 17 00:00:00 2001 From: krlmlr Date: Sun, 18 Oct 2026 09:43:43 +0000 Subject: [PATCH 2/4] chore: Auto-update from GitHub Actions Run: https://github.com/igraph/rigraph/actions/runs/39115844564 --- man/betweenness.Rd | 9 ++++++--- man/cluster_leiden.Rd | 4 ++-- man/count.multiple.Rd | 3 +-- man/edge.betweenness.Rd | 3 +-- man/edge_attr-set.Rd | 8 +++++--- man/edge_attr.Rd | 6 ++++-- man/ends.Rd | 6 ++++-- man/estimate_edge_betweenness.Rd | 3 +-- man/get.edge.attribute.Rd | 3 +-- man/get.vertex.attribute.Rd | 3 +-- man/graphlet_basis.Rd | 8 ++++---- man/graphlets.project.Rd | 2 -- man/head_of.Rd | 6 ++++-- man/incident.Rd | 12 ++++++++++-- man/is.loop.Rd | 3 +-- man/is.multiple.Rd | 3 +-- man/is.mutual.Rd | 3 +-- man/keeping_degseq.Rd | 10 ++++++---- man/layout.bipartite.Rd | 4 ---- man/layout.davidson.harel.Rd | 5 ----- man/layout.gem.Rd | 7 +------ man/layout.graphopt.Rd | 6 ------ man/layout.sugiyama.Rd | 4 ---- man/layout_as_bipartite.Rd | 4 ++-- man/layout_with_dh.Rd | 8 ++++---- man/layout_with_fr.Rd | 4 ++-- man/layout_with_gem.Rd | 6 +++--- man/layout_with_graphopt.Rd | 4 ++-- man/layout_with_kk.Rd | 6 +++--- man/layout_with_lgl.Rd | 4 ++-- man/layout_with_sugiyama.Rd | 4 ++-- man/match_vertices.Rd | 6 ++++-- man/neighbors.Rd | 12 ++++++++++-- man/reverse_edges.Rd | 8 +++++--- man/rewire.Rd | 2 +- man/sample_spanning_tree.Rd | 4 ++-- man/set.edge.attribute.Rd | 5 ++--- man/set.vertex.attribute.Rd | 5 ++--- man/set_edge_attr.Rd | 8 +++++--- man/set_vertex_attr.Rd | 8 +++++--- man/set_vertex_attrs.Rd | 10 ++++++---- man/subcomponent.Rd | 20 ++++++++++++++------ man/subgraph.Rd | 14 +++++++++++--- man/subgraph.edges.Rd | 4 ++-- man/tail_of.Rd | 6 ++++-- man/vertex_attr-set.Rd | 8 +++++--- man/vertex_attr.Rd | 6 ++++-- man/which_multiple.Rd | 10 ++++++---- man/which_mutual.Rd | 6 ++++-- 49 files changed, 166 insertions(+), 137 deletions(-) diff --git a/man/betweenness.Rd b/man/betweenness.Rd index c0a9ef9979..bf6ecae18f 100644 --- a/man/betweenness.Rd +++ b/man/betweenness.Rd @@ -20,11 +20,12 @@ betweenness( edge_betweenness( graph, - e = NULL, + edges = NULL, ..., directed = TRUE, weights = NULL, - cutoff = -1 + cutoff = -1, + e = deprecated() ) } \arguments{ @@ -60,8 +61,10 @@ betweenness. If negative, then there is no such limit.} \item{v}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} -\item{e}{The edges for which the edge betweenness will be calculated. +\item{edges}{The edges for which the edge betweenness will be calculated. The default \code{NULL} selects all edges.} + +\item{e}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A numeric vector with the betweenness score for each vertex in diff --git a/man/cluster_leiden.Rd b/man/cluster_leiden.Rd index 95d3cee34d..d237748cd5 100644 --- a/man/cluster_leiden.Rd +++ b/man/cluster_leiden.Rd @@ -13,7 +13,7 @@ cluster_leiden( resolution = 1, beta = 0.01, initial_membership = NULL, - n_iterations = 2, + n_iter = 2, vertex_weights = NULL ) } @@ -44,7 +44,7 @@ This affects only the refinement step of the algorithm.} will try to improve this provided membership. If no argument is provided, the aglorithm simply starts from the singleton partition.} -\item{n_iterations}{the number of iterations to iterate the Leiden +\item{n_iter}{the number of iterations to iterate the Leiden algorithm. Each iteration may improve the partition further.} \item{vertex_weights}{the vertex weights used in the Leiden algorithm. diff --git a/man/count.multiple.Rd b/man/count.multiple.Rd index a4e624fe0c..d97bbb990f 100644 --- a/man/count.multiple.Rd +++ b/man/count.multiple.Rd @@ -9,8 +9,7 @@ count.multiple(graph, eids = E(graph)) \arguments{ \item{graph}{The input graph.} -\item{eids}{The edges to which the query is restricted. The default -\code{NULL} selects all edges.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/edge.betweenness.Rd b/man/edge.betweenness.Rd index a98737cf18..0ec479ca94 100644 --- a/man/edge.betweenness.Rd +++ b/man/edge.betweenness.Rd @@ -15,8 +15,7 @@ edge.betweenness( \arguments{ \item{graph}{The graph to analyze.} -\item{e}{The edges for which the edge betweenness will be calculated. -The default \code{NULL} selects all edges.} +\item{e}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} \item{directed}{Logical, whether directed paths should be considered while determining the shortest paths.} diff --git a/man/edge_attr-set.Rd b/man/edge_attr-set.Rd index e25638f33e..d46617dbe0 100644 --- a/man/edge_attr-set.Rd +++ b/man/edge_attr-set.Rd @@ -5,7 +5,7 @@ \alias{edge.attributes<-} \title{Set one or more edge attributes} \usage{ -edge_attr(graph, name, index = NULL) <- value +edge_attr(graph, name, edges = NULL, index = deprecated()) <- value } \arguments{ \item{graph}{The graph.} @@ -14,11 +14,13 @@ edge_attr(graph, name, index = NULL) <- value then \code{value} must be a named list, and its entries are set as edge attributes.} -\item{index}{An optional edge sequence to set the attributes +\item{edges}{An optional edge sequence to set the attributes of a subset of edges. The default \code{NULL} selects all edges.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} + \item{value}{The new value of the attribute(s) for all -(or \code{index}) edges.} +(or \code{edges}) edges.} } \value{ The graph, with the edge attribute(s) added or set. diff --git a/man/edge_attr.Rd b/man/edge_attr.Rd index d1a412dc8d..3fca9d6cff 100644 --- a/man/edge_attr.Rd +++ b/man/edge_attr.Rd @@ -5,7 +5,7 @@ \alias{edge.attributes} \title{Query edge attributes of a graph} \usage{ -edge_attr(graph, name, index = NULL) +edge_attr(graph, name, edges = NULL, index = deprecated()) } \arguments{ \item{graph}{The graph} @@ -13,8 +13,10 @@ edge_attr(graph, name, index = NULL) \item{name}{The name of the attribute to query. If missing, then all edge attributes are returned in a list.} -\item{index}{An optional edge sequence to query edge attributes +\item{edges}{An optional edge sequence to query edge attributes for a subset of edges. The default \code{NULL} selects all edges.} + +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ The value of the edge attribute, or the list of all diff --git a/man/ends.Rd b/man/ends.Rd index be8c438198..2fb27f521b 100644 --- a/man/ends.Rd +++ b/man/ends.Rd @@ -5,17 +5,19 @@ \alias{get.edges} \title{Incident vertices of some graph edges} \usage{ -ends(graph, es, ..., names = TRUE) +ends(graph, edges, ..., names = TRUE, es = deprecated()) } \arguments{ \item{graph}{The input graph} -\item{es}{The sequence of edges to query} +\item{edges}{The sequence of edges to query} \item{...}{These dots are for future extensions and must be empty.} \item{names}{Whether to return vertex names or numeric vertex IDs. By default vertex names are used.} + +\item{es}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A two column matrix of vertex names or vertex IDs. diff --git a/man/estimate_edge_betweenness.Rd b/man/estimate_edge_betweenness.Rd index acd055427c..e04e407f35 100644 --- a/man/estimate_edge_betweenness.Rd +++ b/man/estimate_edge_betweenness.Rd @@ -15,8 +15,7 @@ estimate_edge_betweenness( \arguments{ \item{graph}{The graph to analyze.} -\item{e}{The edges for which the edge betweenness will be calculated. -The default \code{NULL} selects all edges.} +\item{e}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} \item{directed}{Logical, whether directed paths should be considered while determining the shortest paths.} diff --git a/man/get.edge.attribute.Rd b/man/get.edge.attribute.Rd index 5fc746f899..d98c7469be 100644 --- a/man/get.edge.attribute.Rd +++ b/man/get.edge.attribute.Rd @@ -12,8 +12,7 @@ get.edge.attribute(graph, name, index = E(graph)) \item{name}{The name of the attribute to query. If missing, then all edge attributes are returned in a list.} -\item{index}{An optional edge sequence to query edge attributes -for a subset of edges. The default \code{NULL} selects all edges.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/get.vertex.attribute.Rd b/man/get.vertex.attribute.Rd index b13e8f4446..21fa5e84a5 100644 --- a/man/get.vertex.attribute.Rd +++ b/man/get.vertex.attribute.Rd @@ -12,8 +12,7 @@ get.vertex.attribute(graph, name, index = V(graph)) \item{name}{Name of the attribute to query. If missing, then all vertex attributes are returned in a list.} -\item{index}{An optional vertex sequence to query the attribute only -for these vertices. The default \code{NULL} selects all vertices.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/graphlet_basis.Rd b/man/graphlet_basis.Rd index 623da40eb6..2e5368507f 100644 --- a/man/graphlet_basis.Rd +++ b/man/graphlet_basis.Rd @@ -8,9 +8,9 @@ \usage{ graphlet_basis(graph, ..., weights = NULL) -graphlet_proj(graph, ..., weights = NULL, cliques, niter = 1000, Mu = NULL) +graphlet_proj(graph, ..., weights = NULL, cliques, n_iter = 1000, Mu = NULL) -graphlets(graph, ..., weights = NULL, niter = 1000) +graphlets(graph, ..., weights = NULL, n_iter = 1000) } \arguments{ \item{graph}{The input graph, edge directions are ignored. Only simple graph @@ -25,7 +25,7 @@ attribute is used.} \item{cliques}{A list of vertex IDs, the graphlet basis to use for the projection.} -\item{niter}{Integer scalar, the number of iterations to perform.} +\item{n_iter}{Integer scalar, the number of iterations to perform.} \item{Mu}{Starting weights for the projection. The default \code{NULL} uses a weight of one for each clique.} @@ -99,7 +99,7 @@ par(mar = c(1, 1, 1, 1)) plot(g, layout = co) ## Calculate graphlets -gl <- graphlets(g, niter = 1000) +gl <- graphlets(g, n_iter = 1000) ## Plot graphlets for (i in seq_along(gl$cliques)) { diff --git a/man/graphlets.project.Rd b/man/graphlets.project.Rd index 535c2c5e9c..99b9c6fb1c 100644 --- a/man/graphlets.project.Rd +++ b/man/graphlets.project.Rd @@ -23,8 +23,6 @@ attribute is used.} \item{cliques}{A list of vertex IDs, the graphlet basis to use for the projection.} -\item{niter}{Integer scalar, the number of iterations to perform.} - \item{Mu}{Starting weights for the projection. The default \code{NULL} uses a weight of one for each clique.} } diff --git a/man/head_of.Rd b/man/head_of.Rd index 4e916b2631..eb29264e59 100644 --- a/man/head_of.Rd +++ b/man/head_of.Rd @@ -4,12 +4,14 @@ \alias{head_of} \title{Head of the edge(s) in a graph} \usage{ -head_of(graph, es) +head_of(graph, edges, es = deprecated()) } \arguments{ \item{graph}{The input graph.} -\item{es}{The edges to query.} +\item{edges}{The edges to query.} + +\item{es}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A vertex sequence with the head(s) of the edge(s). diff --git a/man/incident.Rd b/man/incident.Rd index c0833e4639..d63f30112e 100644 --- a/man/incident.Rd +++ b/man/incident.Rd @@ -4,18 +4,26 @@ \alias{incident} \title{Incident edges of a vertex in a graph} \usage{ -incident(graph, v, ..., mode = c("all", "out", "in", "total")) +incident( + graph, + vertex, + ..., + mode = c("all", "out", "in", "total"), + v = deprecated() +) } \arguments{ \item{graph}{The input graph.} -\item{v}{The vertex of which the incident edges are queried.} +\item{vertex}{The vertex of which the incident edges are queried.} \item{...}{These dots are for future extensions and must be empty.} \item{mode}{Whether to query outgoing (\sQuote{out}), incoming (\sQuote{in}) edges, or both types (\sQuote{all}). This is ignored for undirected graphs.} + +\item{v}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertex} instead.} } \value{ An edge sequence containing the incident edges of diff --git a/man/is.loop.Rd b/man/is.loop.Rd index ce99c88946..6edd60a140 100644 --- a/man/is.loop.Rd +++ b/man/is.loop.Rd @@ -9,8 +9,7 @@ is.loop(graph, eids = E(graph)) \arguments{ \item{graph}{The input graph.} -\item{eids}{The edges to which the query is restricted. The default -\code{NULL} selects all edges.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/is.multiple.Rd b/man/is.multiple.Rd index 8ea9bd2d76..c3c4ddc8cd 100644 --- a/man/is.multiple.Rd +++ b/man/is.multiple.Rd @@ -9,8 +9,7 @@ is.multiple(graph, eids = E(graph)) \arguments{ \item{graph}{The input graph.} -\item{eids}{The edges to which the query is restricted. The default -\code{NULL} selects all edges.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/is.mutual.Rd b/man/is.mutual.Rd index 321108ac67..37b1dc1cf7 100644 --- a/man/is.mutual.Rd +++ b/man/is.mutual.Rd @@ -9,8 +9,7 @@ is.mutual(graph, eids = E(graph), loops = TRUE) \arguments{ \item{graph}{The input graph.} -\item{eids}{Edge sequence, the edges that will be probed. The default -\code{NULL} includes all edges in the order of their IDs.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} \item{loops}{Logical, whether to consider directed self-loops to be mutual.} } diff --git a/man/keeping_degseq.Rd b/man/keeping_degseq.Rd index 225e14316d..c5c8a985da 100644 --- a/man/keeping_degseq.Rd +++ b/man/keeping_degseq.Rd @@ -4,12 +4,14 @@ \alias{keeping_degseq} \title{Graph rewiring while preserving the degree distribution} \usage{ -keeping_degseq(loops = FALSE, niter = 100) +keeping_degseq(loops = FALSE, n_iter = 100, niter = deprecated()) } \arguments{ \item{loops}{Whether to allow destroying and creating loop edges.} -\item{niter}{Number of rewiring trials to perform.} +\item{n_iter}{Number of rewiring trials to perform.} + +\item{niter}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{n_iter} instead.} } \description{ This function can be used together with \code{\link[=rewire]{rewire()}} to @@ -25,9 +27,9 @@ edges. \examples{ g <- make_ring(10) g \%>\% - rewire(keeping_degseq(niter = 20)) \%>\% + rewire(keeping_degseq(n_iter = 20)) \%>\% degree() -print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10))) +print_all(rewire(g, with = keeping_degseq(n_iter = vcount(g) * 10))) } \seealso{ \code{\link[=sample_degseq]{sample_degseq()}} diff --git a/man/layout.bipartite.Rd b/man/layout.bipartite.Rd index a1d9c50972..ffa2e73e3e 100644 --- a/man/layout.bipartite.Rd +++ b/man/layout.bipartite.Rd @@ -19,10 +19,6 @@ used.} same layer.} \item{vgap}{Real scalar, the distance between the two layers.} - -\item{maxiter}{Integer scalar, the maximum number of iterations in the -crossing minimization stage. 100 is a reasonable default; if you feel that -you have too many edge crossings, increase this.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/layout.davidson.harel.Rd b/man/layout.davidson.harel.Rd index 2df57ce460..a9396d33be 100644 --- a/man/layout.davidson.harel.Rd +++ b/man/layout.davidson.harel.Rd @@ -24,11 +24,6 @@ layout.davidson.harel( is not \code{NULL} then it should be an appropriate matrix of starting coordinates.} -\item{maxiter}{Number of iterations to perform in the first phase.} - -\item{fineiter}{Number of iterations in the fine tuning phase. The -default \code{NULL} uses \code{max(10, log2(vcount(graph)))}.} - \item{cool.fact}{Cooling factor.} \item{weight.node.dist}{Weight for the node-node distances component of the diff --git a/man/layout.gem.Rd b/man/layout.gem.Rd index 9046cfc733..e7cefde301 100644 --- a/man/layout.gem.Rd +++ b/man/layout.gem.Rd @@ -20,16 +20,11 @@ layout.gem( depending on the \code{dim} argument. Default: \code{NULL}.} -\item{maxiter}{The maximum number of iterations to perform. Updating a -single vertex counts as an iteration. The default \code{NULL} uses 40 * n * n, -where n is the number of vertices. The original paper suggests 4 * n * n, -but this usually only works if the other parameters are set up carefully.} - \item{temp.max}{The maximum allowed local temperature. The default \code{NULL} uses the number of vertices.} \item{temp.min}{The global temperature at which the algorithm terminates -(even before reaching \code{maxiter} iterations). A reasonable default is +(even before reaching \code{max_iter} iterations). A reasonable default is 1/10.} \item{temp.init}{Initial local temperature of all vertices. The default diff --git a/man/layout.graphopt.Rd b/man/layout.graphopt.Rd index 6ae8c116bd..f107b27e7d 100644 --- a/man/layout.graphopt.Rd +++ b/man/layout.graphopt.Rd @@ -22,12 +22,6 @@ layout.graphopt( line for each vertex. This matrix will be used as starting positions for the algorithm. If not given, then a random starting matrix is used.} -\item{niter}{Integer scalar, the number of iterations to perform. Should be -a couple of hundred in general. If you have a large graph then you might -want to only do a few iterations and then check the result. If it is not -good enough you can feed it in again in the \code{start} argument. The -default value is 500.} - \item{charge}{The charge of the vertices, used to calculate electric repulsion. The default is 0.001.} diff --git a/man/layout.sugiyama.Rd b/man/layout.sugiyama.Rd index 3bf2aa46b0..c310c7727a 100644 --- a/man/layout.sugiyama.Rd +++ b/man/layout.sugiyama.Rd @@ -26,10 +26,6 @@ same layer.} \item{vgap}{Real scalar, the distance between layers.} -\item{maxiter}{Integer scalar, the maximum number of iterations in the -crossing minimization stage. 100 is a reasonable default; if you feel that -you have too many edge crossings, increase this.} - \item{weights}{Optional edge weight vector. If \code{NULL}, then the 'weight' edge attribute is used, if there is one. Supply \code{NA} here and igraph ignores the edge weights. These are used only if the graph diff --git a/man/layout_as_bipartite.Rd b/man/layout_as_bipartite.Rd index 83158b0359..9953eba8d8 100644 --- a/man/layout_as_bipartite.Rd +++ b/man/layout_as_bipartite.Rd @@ -10,7 +10,7 @@ layout_as_bipartite( ..., hgap = 1, vgap = 1, - maxiter = 100 + max_iter = 100 ) } \arguments{ @@ -29,7 +29,7 @@ same layer.} \item{vgap}{Real scalar, the distance between the two layers.} -\item{maxiter}{Integer scalar, the maximum number of iterations in the +\item{max_iter}{Integer scalar, the maximum number of iterations in the crossing minimization stage. 100 is a reasonable default; if you feel that you have too many edge crossings, increase this.} } diff --git a/man/layout_with_dh.Rd b/man/layout_with_dh.Rd index 3b7f56da3c..a8d9e3702d 100644 --- a/man/layout_with_dh.Rd +++ b/man/layout_with_dh.Rd @@ -8,8 +8,8 @@ layout_with_dh( graph, ..., coords = NULL, - maxiter = 10, - fineiter = NULL, + n_iter = 10, + n_fine_iter = NULL, cool.fact = 0.75, weight.node.dist = 1, weight.border = 0, @@ -27,9 +27,9 @@ layout_with_dh( is not \code{NULL} then it should be an appropriate matrix of starting coordinates.} -\item{maxiter}{Number of iterations to perform in the first phase.} +\item{n_iter}{Number of iterations to perform in the first phase.} -\item{fineiter}{Number of iterations in the fine tuning phase. The +\item{n_fine_iter}{Number of iterations in the fine tuning phase. The default \code{NULL} uses \code{max(10, log2(vcount(graph)))}.} \item{cool.fact}{Cooling factor.} diff --git a/man/layout_with_fr.Rd b/man/layout_with_fr.Rd index 22bb407806..d681802022 100644 --- a/man/layout_with_fr.Rd +++ b/man/layout_with_fr.Rd @@ -9,7 +9,7 @@ layout_with_fr( ..., coords = NULL, dim = c(2, 3), - niter = 500, + n_iter = 500, start.temp = NULL, grid = c("auto", "grid", "nogrid"), weights = NULL, @@ -38,7 +38,7 @@ coordinates.} dimensional layouts are places on a plane, three dimensional ones in the 3d space.} -\item{niter}{Integer scalar, the number of iterations to perform.} +\item{n_iter}{Integer scalar, the number of iterations to perform.} \item{start.temp}{Real scalar, the start temperature. This is the maximum amount of movement alloved along one axis, within one step, for a vertex. diff --git a/man/layout_with_gem.Rd b/man/layout_with_gem.Rd index 9fb74e2a0f..620861c36d 100644 --- a/man/layout_with_gem.Rd +++ b/man/layout_with_gem.Rd @@ -8,7 +8,7 @@ layout_with_gem( graph, ..., coords = NULL, - maxiter = NULL, + max_iter = NULL, temp.max = NULL, temp.min = 0.1, temp.init = NULL @@ -23,7 +23,7 @@ layout_with_gem( depending on the \code{dim} argument. Default: \code{NULL}.} -\item{maxiter}{The maximum number of iterations to perform. Updating a +\item{max_iter}{The maximum number of iterations to perform. Updating a single vertex counts as an iteration. The default \code{NULL} uses 40 * n * n, where n is the number of vertices. The original paper suggests 4 * n * n, but this usually only works if the other parameters are set up carefully.} @@ -32,7 +32,7 @@ but this usually only works if the other parameters are set up carefully.} uses the number of vertices.} \item{temp.min}{The global temperature at which the algorithm terminates -(even before reaching \code{maxiter} iterations). A reasonable default is +(even before reaching \code{max_iter} iterations). A reasonable default is 1/10.} \item{temp.init}{Initial local temperature of all vertices. The default diff --git a/man/layout_with_graphopt.Rd b/man/layout_with_graphopt.Rd index 0d56e5ff1f..9baea2ef59 100644 --- a/man/layout_with_graphopt.Rd +++ b/man/layout_with_graphopt.Rd @@ -8,7 +8,7 @@ layout_with_graphopt( graph, ..., start = NULL, - niter = 500, + n_iter = 500, charge = 0.001, mass = 30, spring.length = 0, @@ -25,7 +25,7 @@ layout_with_graphopt( line for each vertex. This matrix will be used as starting positions for the algorithm. If not given, then a random starting matrix is used.} -\item{niter}{Integer scalar, the number of iterations to perform. Should be +\item{n_iter}{Integer scalar, the number of iterations to perform. Should be a couple of hundred in general. If you have a large graph then you might want to only do a few iterations and then check the result. If it is not good enough you can feed it in again in the \code{start} argument. The diff --git a/man/layout_with_kk.Rd b/man/layout_with_kk.Rd index 2f20828c43..78ba3af4c0 100644 --- a/man/layout_with_kk.Rd +++ b/man/layout_with_kk.Rd @@ -9,7 +9,7 @@ layout_with_kk( ..., coords = NULL, dim = c(2, 3), - maxiter = NULL, + max_iter = NULL, epsilon = 0, kkconst = NULL, weights = NULL, @@ -39,13 +39,13 @@ Default: \code{NULL}.} dimensional layouts are places on a plane, three dimensional ones in the 3d space.} -\item{maxiter}{The maximum number of iterations to perform. The algorithm +\item{max_iter}{The maximum number of iterations to perform. The algorithm might terminate earlier, see the \code{epsilon} argument. The default \code{NULL} uses \code{50 * vcount(graph)}.} \item{epsilon}{Numeric scalar, the algorithm terminates, if the maximal delta is less than this. (See the reference below for what delta means.) If -you set this to zero, then the function always performs \code{maxiter} +you set this to zero, then the function always performs \code{max_iter} iterations.} \item{kkconst}{Numeric scalar, the Kamada-Kawai vertex attraction constant. diff --git a/man/layout_with_lgl.Rd b/man/layout_with_lgl.Rd index 3a41057a0e..4faf04ccf6 100644 --- a/man/layout_with_lgl.Rd +++ b/man/layout_with_lgl.Rd @@ -7,7 +7,7 @@ layout_with_lgl( graph, ..., - maxiter = 150, + max_iter = 150, maxdelta = NULL, area = NULL, coolexp = 1.5, @@ -21,7 +21,7 @@ layout_with_lgl( \item{...}{These dots are for future extensions and must be empty.} -\item{maxiter}{The maximum number of iterations to perform (150).} +\item{max_iter}{The maximum number of iterations to perform (150).} \item{maxdelta}{The maximum change for a vertex during an iteration. The default \code{NULL} uses the number of vertices.} diff --git a/man/layout_with_sugiyama.Rd b/man/layout_with_sugiyama.Rd index 11e4ecf083..4199801d81 100644 --- a/man/layout_with_sugiyama.Rd +++ b/man/layout_with_sugiyama.Rd @@ -10,7 +10,7 @@ layout_with_sugiyama( layers = NULL, hgap = 1, vgap = 1, - maxiter = 100, + max_iter = 100, weights = NULL, attributes = c("default", "all", "none") ) @@ -29,7 +29,7 @@ same layer.} \item{vgap}{Real scalar, the distance between layers.} -\item{maxiter}{Integer scalar, the maximum number of iterations in the +\item{max_iter}{Integer scalar, the maximum number of iterations in the crossing minimization stage. 100 is a reasonable default; if you feel that you have too many edge crossings, increase this.} diff --git a/man/match_vertices.Rd b/man/match_vertices.Rd index f65f79ae54..eb7a46933d 100644 --- a/man/match_vertices.Rd +++ b/man/match_vertices.Rd @@ -5,7 +5,7 @@ \alias{seeded.graph.match} \title{Match Graphs given a seeding of vertex correspondences} \usage{ -match_vertices(A, B, m, start, iteration) +match_vertices(A, B, m, start, max_iter, iteration = deprecated()) } \arguments{ \item{A}{a numeric matrix, the adjacency matrix of the first graph} @@ -18,7 +18,9 @@ matched.} \item{start}{a numeric matrix, the permutation matrix estimate is initialized with \code{start}} -\item{iteration}{The number of iterations for the Frank-Wolfe algorithm} +\item{max_iter}{The number of iterations for the Frank-Wolfe algorithm} + +\item{iteration}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{max_iter} instead.} } \value{ A numeric matrix which is the permutation matrix that determines the diff --git a/man/neighbors.Rd b/man/neighbors.Rd index 7ddf86de6c..40d37357bf 100644 --- a/man/neighbors.Rd +++ b/man/neighbors.Rd @@ -4,18 +4,26 @@ \alias{neighbors} \title{Neighboring (adjacent) vertices in a graph} \usage{ -neighbors(graph, v, ..., mode = c("out", "in", "all", "total")) +neighbors( + graph, + vertex, + ..., + mode = c("out", "in", "all", "total"), + v = deprecated() +) } \arguments{ \item{graph}{The input graph.} -\item{v}{The vertex of which the adjacent vertices are queried.} +\item{vertex}{The vertex of which the adjacent vertices are queried.} \item{...}{These dots are for future extensions and must be empty.} \item{mode}{Whether to query outgoing (\sQuote{out}), incoming (\sQuote{in}) edges, or both types (\sQuote{all}). This is ignored for undirected graphs.} + +\item{v}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertex} instead.} } \value{ A vertex sequence containing the neighbors of the input vertex. diff --git a/man/reverse_edges.Rd b/man/reverse_edges.Rd index f4d0cd085f..08488ebddf 100644 --- a/man/reverse_edges.Rd +++ b/man/reverse_edges.Rd @@ -5,16 +5,18 @@ \alias{t.igraph} \title{Reverse edges in a graph} \usage{ -reverse_edges(graph, eids = NULL) +reverse_edges(graph, edges = NULL, eids = deprecated()) \method{t}{igraph}(x) } \arguments{ \item{graph}{The input graph.} -\item{eids}{The edge IDs of the edges to reverse. The default \code{NULL} +\item{edges}{The edge IDs of the edges to reverse. The default \code{NULL} reverses all edges.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} + \item{x}{The input graph.} } \value{ @@ -24,7 +26,7 @@ IDs are reversed \description{ The new graph will contain the same vertices, edges and attributes as the original graph, except that the direction of the edges selected by -their edge IDs in the \code{eids} argument will be reversed. When reversing +their edge IDs in the \code{edges} argument will be reversed. When reversing all edges, this operation is also known as graph transpose. } \section{Related documentation in the C library}{ diff --git a/man/rewire.Rd b/man/rewire.Rd index 773aa11d69..c8bb7d561a 100644 --- a/man/rewire.Rd +++ b/man/rewire.Rd @@ -23,7 +23,7 @@ g <- make_ring(10) g \%>\% rewire(each_edge(p = 0.1, loops = FALSE)) \%>\% plot(layout = layout_in_circle) -print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10))) +print_all(rewire(g, with = keeping_degseq(n_iter = vcount(g) * 10))) } \seealso{ Other rewiring functions: diff --git a/man/sample_spanning_tree.Rd b/man/sample_spanning_tree.Rd index a6b5665dbb..d6d02f4603 100644 --- a/man/sample_spanning_tree.Rd +++ b/man/sample_spanning_tree.Rd @@ -4,7 +4,7 @@ \alias{sample_spanning_tree} \title{Samples from the spanning trees of a graph randomly and uniformly} \usage{ -sample_spanning_tree(graph, ..., vid = 0) +sample_spanning_tree(graph, ..., vertex = 0) } \arguments{ \item{graph}{The input graph to sample from. Edge directions are ignored if @@ -12,7 +12,7 @@ the graph is directed.} \item{...}{These dots are for future extensions and must be empty.} -\item{vid}{When the graph is disconnected, this argument specifies how to +\item{vertex}{When the graph is disconnected, this argument specifies how to handle the situation. When the argument is zero (the default), the sampling will be performed component-wise, and the result will be a spanning forest. When the argument contains a vertex ID, only the component containing the diff --git a/man/set.edge.attribute.Rd b/man/set.edge.attribute.Rd index d88601f71b..a637b18480 100644 --- a/man/set.edge.attribute.Rd +++ b/man/set.edge.attribute.Rd @@ -11,10 +11,9 @@ set.edge.attribute(graph, name, index = E(graph), value) \item{name}{The name of the attribute to set.} -\item{index}{An optional edge sequence to set the attributes of -a subset of edges. The default \code{NULL} selects all edges.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} -\item{value}{The new value of the attribute for all (or \code{index}) +\item{value}{The new value of the attribute for all (or \code{edges}) edges. If \code{NULL}, the input is returned unchanged.} } diff --git a/man/set.vertex.attribute.Rd b/man/set.vertex.attribute.Rd index f24c2f3077..df64d5bb10 100644 --- a/man/set.vertex.attribute.Rd +++ b/man/set.vertex.attribute.Rd @@ -11,10 +11,9 @@ set.vertex.attribute(graph, name, index = V(graph), value) \item{name}{The name of the attribute to set.} -\item{index}{An optional vertex sequence to set the attributes -of a subset of vertices. The default \code{NULL} selects all vertices.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} -\item{value}{The new value of the attribute for all (or \code{index}) +\item{value}{The new value of the attribute for all (or \code{vertices}) vertices. If \code{NULL}, the input is returned unchanged.} } diff --git a/man/set_edge_attr.Rd b/man/set_edge_attr.Rd index ab5dd24576..0b9e87d89c 100644 --- a/man/set_edge_attr.Rd +++ b/man/set_edge_attr.Rd @@ -4,19 +4,21 @@ \alias{set_edge_attr} \title{Set edge attributes} \usage{ -set_edge_attr(graph, name, index = NULL, value) +set_edge_attr(graph, name, edges = NULL, value, index = deprecated()) } \arguments{ \item{graph}{The graph} \item{name}{The name of the attribute to set.} -\item{index}{An optional edge sequence to set the attributes of +\item{edges}{An optional edge sequence to set the attributes of a subset of edges. The default \code{NULL} selects all edges.} -\item{value}{The new value of the attribute for all (or \code{index}) +\item{value}{The new value of the attribute for all (or \code{edges}) edges. If \code{NULL}, the input is returned unchanged.} + +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ The graph, with the edge attribute added or set. diff --git a/man/set_vertex_attr.Rd b/man/set_vertex_attr.Rd index 5d315ad020..86902da258 100644 --- a/man/set_vertex_attr.Rd +++ b/man/set_vertex_attr.Rd @@ -4,19 +4,21 @@ \alias{set_vertex_attr} \title{Set vertex attributes} \usage{ -set_vertex_attr(graph, name, index = NULL, value) +set_vertex_attr(graph, name, vertices = NULL, value, index = deprecated()) } \arguments{ \item{graph}{The graph.} \item{name}{The name of the attribute to set.} -\item{index}{An optional vertex sequence to set the attributes +\item{vertices}{An optional vertex sequence to set the attributes of a subset of vertices. The default \code{NULL} selects all vertices.} -\item{value}{The new value of the attribute for all (or \code{index}) +\item{value}{The new value of the attribute for all (or \code{vertices}) vertices. If \code{NULL}, the input is returned unchanged.} + +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} } \value{ The graph, with the vertex attribute added or set. diff --git a/man/set_vertex_attrs.Rd b/man/set_vertex_attrs.Rd index ca504251f0..f6f03577c2 100644 --- a/man/set_vertex_attrs.Rd +++ b/man/set_vertex_attrs.Rd @@ -4,15 +4,17 @@ \alias{set_vertex_attrs} \title{Set multiple vertex attributes} \usage{ -set_vertex_attrs(graph, ..., index = NULL) +set_vertex_attrs(graph, ..., vertices = NULL, index = deprecated()) } \arguments{ \item{graph}{The graph.} \item{...}{<\code{\link[rlang:dyn-dots]{dynamic-dots}}> Named arguments, where the names are the attributes} -\item{index}{An optional vertex sequence to set the attributes +\item{vertices}{An optional vertex sequence to set the attributes of a subset of vertices. The default \code{NULL} selects all vertices.} + +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} } \value{ The graph, with the vertex attributes added or set. @@ -30,8 +32,8 @@ set_vertex_attrs(g, color = "blue", size = 10, name = LETTERS[1:10]) # use splicing if suplying a list x <- list(color = "red", name = LETTERS[1:10]) set_vertex_attrs(g, !!!x) -# to set an attribute named "index" use `:=` -set_vertex_attrs(g, color = "blue", index := 10, name = LETTERS[1:10]) +# to set an attribute named "vertices" use `:=` +set_vertex_attrs(g, color = "blue", vertices := 10, name = LETTERS[1:10]) } \seealso{ Vertex, edge and graph attributes: diff --git a/man/subcomponent.Rd b/man/subcomponent.Rd index cd4092391c..4a0c9f63b2 100644 --- a/man/subcomponent.Rd +++ b/man/subcomponent.Rd @@ -4,31 +4,39 @@ \alias{subcomponent} \title{In- or out- component of a vertex} \usage{ -subcomponent(graph, v, ..., mode = c("all", "out", "in")) +subcomponent( + graph, + vertex, + ..., + mode = c("all", "out", "in"), + v = deprecated() +) } \arguments{ \item{graph}{The graph to analyze.} -\item{v}{The vertex to start the search from.} +\item{vertex}{The vertex to start the search from.} \item{...}{These dots are for future extensions and must be empty.} \item{mode}{Character string, either \dQuote{in}, \dQuote{out} or -\dQuote{all}. If \dQuote{in} all vertices from which \code{v} is reachable -are listed. If \dQuote{out} all vertices reachable from \code{v} are +\dQuote{all}. If \dQuote{in} all vertices from which \code{vertex} is reachable +are listed. If \dQuote{out} all vertices reachable from \code{vertex} are returned. If \dQuote{all} returns the union of these. It is ignored for undirected graphs.} + +\item{v}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertex} instead.} } \value{ Numeric vector, the IDs of the vertices in the same component as -\code{v}. +\code{vertex}. } \description{ Finds all vertices reachable from a given vertex, or the opposite: all vertices from which a given vertex is reachable via a directed path. } \details{ -A breadth-first search is conducted starting from vertex \code{v}. +A breadth-first search is conducted starting from vertex \code{vertex}. } \section{Related documentation in the C library}{ \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}} diff --git a/man/subgraph.Rd b/man/subgraph.Rd index 3dd9858bb6..41ece1613b 100644 --- a/man/subgraph.Rd +++ b/man/subgraph.Rd @@ -16,7 +16,13 @@ induced_subgraph( vids = deprecated() ) -subgraph_from_edges(graph, eids, ..., delete.vertices = TRUE) +subgraph_from_edges( + graph, + edges, + ..., + delete.vertices = TRUE, + eids = deprecated() +) } \arguments{ \item{graph}{The original graph.} @@ -37,10 +43,12 @@ scratch. \sQuote{\code{auto}} chooses between the two implementations automatically, using heuristics based on the size of the original and the result graph.} -\item{eids}{The edge IDs of the edges that will be kept in the result graph.} +\item{edges}{The edge IDs of the edges that will be kept in the result graph.} \item{delete.vertices}{Logical, whether to remove vertices that do -not have any adjacent edges in \code{eids}.} +not have any adjacent edges in \code{edges}.} + +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A new graph object. diff --git a/man/subgraph.edges.Rd b/man/subgraph.edges.Rd index 903f76914b..9b5d74bf5d 100644 --- a/man/subgraph.edges.Rd +++ b/man/subgraph.edges.Rd @@ -9,10 +9,10 @@ subgraph.edges(graph, eids, delete.vertices = TRUE) \arguments{ \item{graph}{The original graph.} -\item{eids}{The edge IDs of the edges that will be kept in the result graph.} +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} \item{delete.vertices}{Logical, whether to remove vertices that do -not have any adjacent edges in \code{eids}.} +not have any adjacent edges in \code{edges}.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} diff --git a/man/tail_of.Rd b/man/tail_of.Rd index 91f16cab2a..fb176dde06 100644 --- a/man/tail_of.Rd +++ b/man/tail_of.Rd @@ -4,12 +4,14 @@ \alias{tail_of} \title{Tails of the edge(s) in a graph} \usage{ -tail_of(graph, es) +tail_of(graph, edges, es = deprecated()) } \arguments{ \item{graph}{The input graph.} -\item{es}{The edges to query.} +\item{edges}{The edges to query.} + +\item{es}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A vertex sequence with the tail(s) of the edge(s). diff --git a/man/vertex_attr-set.Rd b/man/vertex_attr-set.Rd index 817c5abfe5..febd48feac 100644 --- a/man/vertex_attr-set.Rd +++ b/man/vertex_attr-set.Rd @@ -5,7 +5,7 @@ \alias{vertex.attributes<-} \title{Set one or more vertex attributes} \usage{ -vertex_attr(graph, name, index = NULL) <- value +vertex_attr(graph, name, vertices = NULL, index = deprecated()) <- value } \arguments{ \item{graph}{The graph.} @@ -14,11 +14,13 @@ vertex_attr(graph, name, index = NULL) <- value then \code{value} must be a named list, and its entries are set as vertex attributes.} -\item{index}{An optional vertex sequence to set the attributes +\item{vertices}{An optional vertex sequence to set the attributes of a subset of vertices. The default \code{NULL} selects all vertices.} +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} + \item{value}{The new value of the attribute(s) for all -(or \code{index}) vertices.} +(or \code{vertices}) vertices.} } \value{ The graph, with the vertex attribute(s) added or set. diff --git a/man/vertex_attr.Rd b/man/vertex_attr.Rd index 5a864092fe..72075de771 100644 --- a/man/vertex_attr.Rd +++ b/man/vertex_attr.Rd @@ -5,7 +5,7 @@ \alias{vertex.attributes} \title{Query vertex attributes of a graph} \usage{ -vertex_attr(graph, name, index = NULL) +vertex_attr(graph, name, vertices = NULL, index = deprecated()) } \arguments{ \item{graph}{The graph.} @@ -13,8 +13,10 @@ vertex_attr(graph, name, index = NULL) \item{name}{Name of the attribute to query. If missing, then all vertex attributes are returned in a list.} -\item{index}{An optional vertex sequence to query the attribute only +\item{vertices}{An optional vertex sequence to query the attribute only for these vertices. The default \code{NULL} selects all vertices.} + +\item{index}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{vertices} instead.} } \value{ The value of the vertex attribute, or the list of diff --git a/man/which_multiple.Rd b/man/which_multiple.Rd index 4d166b4a5a..8fa03ad52c 100644 --- a/man/which_multiple.Rd +++ b/man/which_multiple.Rd @@ -9,13 +9,13 @@ \alias{count_loops} \title{Find the multiple or loop edges in a graph} \usage{ -which_multiple(graph, eids = NULL) +which_multiple(graph, edges = NULL, eids = deprecated()) any_multiple(graph) -count_multiple(graph, eids = NULL) +count_multiple(graph, edges = NULL, eids = deprecated()) -which_loop(graph, eids = NULL) +which_loop(graph, edges = NULL, eids = deprecated()) any_loop(graph) @@ -24,8 +24,10 @@ count_loops(graph) \arguments{ \item{graph}{The input graph.} -\item{eids}{The edges to which the query is restricted. The default +\item{edges}{The edges to which the query is restricted. The default \code{NULL} selects all edges.} + +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ \code{any_loop()} and \code{any_multiple()} return a Logical. diff --git a/man/which_mutual.Rd b/man/which_mutual.Rd index 46346529c7..a9ed74426e 100644 --- a/man/which_mutual.Rd +++ b/man/which_mutual.Rd @@ -4,17 +4,19 @@ \alias{which_mutual} \title{Find mutual edges in a directed graph} \usage{ -which_mutual(graph, eids = NULL, ..., loops = TRUE) +which_mutual(graph, edges = NULL, ..., loops = TRUE, eids = deprecated()) } \arguments{ \item{graph}{The input graph.} -\item{eids}{Edge sequence, the edges that will be probed. The default +\item{edges}{Edge sequence, the edges that will be probed. The default \code{NULL} includes all edges in the order of their IDs.} \item{...}{These dots are for future extensions and must be empty.} \item{loops}{Logical, whether to consider directed self-loops to be mutual.} + +\item{eids}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Use \code{edges} instead.} } \value{ A logical vector of the same length as the number of edges supplied. From 3b1281718ee1a0d11242ab3ebcfc57537baae49b Mon Sep 17 00:00:00 2001 From: David Schoch Date: Wed, 2 Dec 2026 21:17:04 +0100 Subject: [PATCH 3/4] test: Cover the remaining `maxiter` renames of the layouts layout_with_gem(), layout_with_lgl(), layout_as_bipartite() and layout_with_sugiyama() renamed `maxiter` to `max_iter` without a test that the legacy name still works and gives the same layout. Co-Authored-By: Claude Opus 5.5 --- tests/testthat/test-layout.R | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tests/testthat/test-layout.R b/tests/testthat/test-layout.R index 09ac0e85c2..6a0e004796 100644 --- a/tests/testthat/test-layout.R +++ b/tests/testthat/test-layout.R @@ -982,6 +982,29 @@ test_that("legacy iteration argument names are deprecated but still work", { lifecycle::expect_deprecated(res <- layout_with_graphopt(g, niter = 50)) igraph_local_seed(42) expect_equal(res, layout_with_graphopt(g, n_iter = 50)) + + igraph_local_seed(42) + lifecycle::expect_deprecated(res <- layout_with_gem(g, maxiter = 50)) + igraph_local_seed(42) + expect_equal(res, layout_with_gem(g, max_iter = 50)) + + igraph_local_seed(42) + lifecycle::expect_deprecated(res <- layout_with_lgl(g, maxiter = 50)) + igraph_local_seed(42) + expect_equal(res, layout_with_lgl(g, max_iter = 50)) + + bip <- make_bipartite_graph(c(0, 1, 0, 1), c(1, 2, 2, 3, 3, 4)) + lifecycle::expect_deprecated(res <- layout_as_bipartite(bip, maxiter = 10)) + expect_equal(res, layout_as_bipartite(bip, max_iter = 10)) + + tree <- make_tree(7) + lifecycle::expect_deprecated( + res <- layout_with_sugiyama(tree, maxiter = 10) + ) + ref <- layout_with_sugiyama(tree, max_iter = 10) + expect_equal(res$layout, ref$layout) + expect_equal(res$layout.dummy, ref$layout.dummy) + expect_identical_graphs(res$extd_graph, ref$extd_graph) }) test_that("layout_with_gem() random stream for a fixed seed", { From f643a04dbd3c7ce974cf9394c6c92c0614f28411 Mon Sep 17 00:00:00 2001 From: David Schoch Date: Thu, 3 Dec 2026 07:34:49 +0100 Subject: [PATCH 4/4] test: Update snapshots for the clearer migration messages Co-Authored-By: Claude Opus 5.5 --- tests/testthat/_snaps/community.md | 2 +- tests/testthat/_snaps/layout.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/testthat/_snaps/community.md b/tests/testthat/_snaps/community.md index ec0ab0c0d7..f44d129656 100644 --- a/tests/testthat/_snaps/community.md +++ b/tests/testthat/_snaps/community.md @@ -13,7 +13,7 @@ res <- cluster_leiden(g, "modularity", NULL, 1.5) Condition Warning: - Calling `cluster_leiden()` with positional or abbreviated arguments was deprecated in igraph 3.0.0. + Calling `cluster_leiden()` with positional, abbreviated or renamed arguments was deprecated in igraph 3.0.0. i Detected call: cluster_leiden(graph, objective_function, weights, resolution_parameter) i Use instead: cluster_leiden(graph, objective_function, weights = , resolution_parameter = ) Warning: diff --git a/tests/testthat/_snaps/layout.md b/tests/testthat/_snaps/layout.md index 3757f21373..92f6e6625c 100644 --- a/tests/testthat/_snaps/layout.md +++ b/tests/testthat/_snaps/layout.md @@ -38,7 +38,7 @@ res <- layout_with_fr(g, coords = coords, niter = 20) Condition Warning: - Calling `layout_with_fr()` with positional or abbreviated arguments was deprecated in igraph 3.0.0. - i Detected call: layout_with_fr(graph, niter) + Calling `layout_with_fr()` with positional, abbreviated or renamed arguments was deprecated in igraph 3.0.0. + i Detected call: layout_with_fr(graph, niter = ) i Use instead: layout_with_fr(graph, n_iter = )