From eecb40dbddbf8db9b21ce209f515e99179af92b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 23:05:21 +0000 Subject: [PATCH 1/4] Initial plan From 82728d86efcdb09eb4174c57749489cf4e3f2db7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 23:45:00 +0000 Subject: [PATCH 2/4] Rename 'nodes' to 'n' in game generator functions Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com> --- R/games.R | 44 +++++++++++++++---------------- man/asymmetric.preference.game.Rd | 2 -- man/callaway.traits.game.Rd | 2 -- man/establishment.game.Rd | 2 -- man/forest.fire.game.Rd | 2 -- man/grg.game.Rd | 2 -- man/preference.game.Rd | 2 -- man/sample_forestfire.Rd | 4 +-- man/sample_grg.Rd | 4 +-- man/sample_pref.Rd | 6 ++--- man/sample_traits_callaway.Rd | 6 ++--- 11 files changed, 32 insertions(+), 44 deletions(-) diff --git a/R/games.R b/R/games.R index 57a106e4d9e..e0b505aed16 100644 --- a/R/games.R +++ b/R/games.R @@ -150,7 +150,7 @@ preference.game <- function( # nocov start lifecycle::deprecate_soft("2.0.0", "preference.game()", "sample_pref()") sample_pref( - nodes = nodes, + n = nodes, types = types, type.dist = type.dist, fixed.sizes = fixed.sizes, @@ -252,7 +252,7 @@ interconnected.islands.game <- function( grg.game <- function(nodes, radius, torus = FALSE, coords = FALSE) { # nocov start lifecycle::deprecate_soft("2.0.0", "grg.game()", "sample_grg()") - sample_grg(nodes = nodes, radius = radius, torus = torus, coords = coords) + sample_grg(n = nodes, radius = radius, torus = torus, coords = coords) } # nocov end #' Growing random graph generation @@ -299,7 +299,7 @@ forest.fire.game <- function( "sample_forestfire()" ) sample_forestfire( - nodes = nodes, + n = nodes, fw.prob = fw.prob, bw.factor = bw.factor, ambs = ambs, @@ -328,7 +328,7 @@ establishment.game <- function( # nocov start lifecycle::deprecate_soft("2.0.0", "establishment.game()", "sample_traits()") sample_traits( - nodes = nodes, + n = nodes, types = types, k = k, type.dist = type.dist, @@ -470,7 +470,7 @@ callaway.traits.game <- function( "sample_traits_callaway()" ) sample_traits_callaway( - nodes = nodes, + n = nodes, types = types, edge.per.step = edge.per.step, type.dist = type.dist, @@ -615,7 +615,7 @@ asymmetric.preference.game <- function( "sample_asym_pref()" ) sample_asym_pref( - nodes = nodes, + n = nodes, types = types, type.dist.matrix = type.dist.matrix, pref.matrix = pref.matrix, @@ -1729,7 +1729,7 @@ pa_age <- function(...) constructor_spec(sample_pa_age, ...) #' depends on the types of the vertices involved and is taken from #' `pref.matrix`. #' -#' @param nodes The number of vertices in the graph. +#' @param n The number of vertices in the graph. #' @param types The number of different vertex types. #' @param edge.per.step The number of edges to add to the graph per time step. #' @param type.dist The distribution of the vertex types. This is assumed to be @@ -1749,7 +1749,7 @@ pa_age <- function(...) constructor_spec(sample_pa_age, ...) #' g1 <- sample_traits_callaway(1000, 2, pref.matrix = matrix(c(1, 0, 0, 1), ncol = 2)) #' g2 <- sample_traits(1000, 2, k = 2, pref.matrix = matrix(c(1, 0, 0, 1), ncol = 2)) sample_traits_callaway <- function( - nodes, + n, types, edge.per.step = 1, type.dist = rep(1, types), @@ -1759,7 +1759,7 @@ sample_traits_callaway <- function( on.exit(.Call(R_igraph_finalizer)) res <- .Call( R_igraph_callaway_traits_game, - as.double(nodes), + as.double(n), as.double(types), as.double(edge.per.step), as.double(type.dist), @@ -1789,7 +1789,7 @@ traits_callaway <- function(...) constructor_spec(sample_traits_callaway, ...) #' @rdname sample_traits_callaway #' @export sample_traits <- function( - nodes, + n, types, k = 1, type.dist = rep(1, types), @@ -1799,7 +1799,7 @@ sample_traits <- function( on.exit(.Call(R_igraph_finalizer)) res <- .Call( R_igraph_establishment_game, - as.double(nodes), + as.double(n), as.double(types), as.double(k), as.double(type.dist), @@ -1833,7 +1833,7 @@ traits <- function(...) constructor_spec(sample_traits, ...) #' Euclidean norm than a given radius. If the `torus` argument is #' `TRUE` then a unit area torus is used instead of a square. #' -#' @param nodes The number of vertices in the graph. +#' @param n The number of vertices in the graph. #' @param radius The radius within which the vertices will be connected by an #' edge. #' @param torus Logical constant, whether to use a torus instead of a square. @@ -1851,11 +1851,11 @@ traits <- function(...) constructor_spec(sample_traits, ...) #' g <- sample_grg(1000, 0.05, torus = FALSE) #' g2 <- sample_grg(1000, 0.05, torus = TRUE) #' -sample_grg <- function(nodes, radius, torus = FALSE, coords = FALSE) { +sample_grg <- function(n, radius, torus = FALSE, coords = FALSE) { on.exit(.Call(R_igraph_finalizer)) res <- .Call( R_igraph_grg_game, - as.double(nodes), + as.double(n), as.double(radius), as.logical(torus), as.logical(coords) @@ -1901,7 +1901,7 @@ grg <- function(...) constructor_spec(sample_grg, ...) #' `type` vertex attribute for `sample_pref()` and from the #' `intype` and `outtype` vertex attribute for `sample_asym_pref()`. #' -#' @param nodes The number of vertices in the graphs. +#' @param n The number of vertices in the graphs. #' @param types The number of different vertex types. #' @param type.dist The distribution of the vertex types, a numeric vector of #' length \sQuote{types} containing non-negative numbers. The vector will be @@ -1938,7 +1938,7 @@ grg <- function(...) constructor_spec(sample_grg, ...) #' tkplot(g, layout = layout_in_circle) #' sample_pref <- function( - nodes, + n, types, type.dist = rep(1, types), fixed.sizes = FALSE, @@ -1956,7 +1956,7 @@ sample_pref <- function( on.exit(.Call(R_igraph_finalizer)) res <- .Call( R_igraph_preference_game, - as.numeric(nodes), + as.numeric(n), as.numeric(types), as.double(type.dist), as.logical(fixed.sizes), @@ -1985,7 +1985,7 @@ pref <- function(...) constructor_spec(sample_pref, ...) #' @rdname sample_pref #' @export sample_asym_pref <- function( - nodes, + n, types, type.dist.matrix = matrix(1, types, types), pref.matrix = matrix(1, types, types), @@ -2007,7 +2007,7 @@ sample_asym_pref <- function( on.exit(.Call(R_igraph_finalizer)) res <- .Call( R_igraph_asymmetric_preference_game, - as.numeric(nodes), + as.numeric(n), as.numeric(types), as.numeric(types), matrix(as.double(type.dist.matrix), types, types), @@ -3120,7 +3120,7 @@ sample_fitness_pl <- function( #' available then we cite all of them. \item The same procedure is applied to #' all the newly cited vertices. } #' -#' @param nodes The number of vertices in the graph. +#' @param n The number of vertices in the graph. #' @param fw.prob The forward burning probability, see details below. #' @param bw.factor The backward burning ratio. The backward burning #' probability is calculated as `bw.factor*fw.prob`. @@ -3157,14 +3157,14 @@ sample_fitness_pl <- function( #' points(seq(along.with = dd2) - 1, dd2, col = 2, pch = 2) #' @cdocs igraph_forest_fire_game sample_forestfire <- function( - nodes, + n, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE ) { forest_fire_game_impl( - nodes = nodes, + nodes = n, fw.prob = fw.prob, bw.factor = bw.factor, ambs = ambs, diff --git a/man/asymmetric.preference.game.Rd b/man/asymmetric.preference.game.Rd index 00b6b8a1494..6e362bc21b3 100644 --- a/man/asymmetric.preference.game.Rd +++ b/man/asymmetric.preference.game.Rd @@ -13,8 +13,6 @@ asymmetric.preference.game( ) } \arguments{ -\item{nodes}{The number of vertices in the graphs.} - \item{types}{The number of different vertex types.} \item{type.dist.matrix}{The joint distribution of the in- and out-vertex diff --git a/man/callaway.traits.game.Rd b/man/callaway.traits.game.Rd index 532d56b26a1..e2bf60f03b6 100644 --- a/man/callaway.traits.game.Rd +++ b/man/callaway.traits.game.Rd @@ -14,8 +14,6 @@ callaway.traits.game( ) } \arguments{ -\item{nodes}{The number of vertices in the graph.} - \item{types}{The number of different vertex types.} \item{edge.per.step}{The number of edges to add to the graph per time step.} diff --git a/man/establishment.game.Rd b/man/establishment.game.Rd index 5147127c9ba..80c68934ea9 100644 --- a/man/establishment.game.Rd +++ b/man/establishment.game.Rd @@ -14,8 +14,6 @@ establishment.game( ) } \arguments{ -\item{nodes}{The number of vertices in the graph.} - \item{types}{The number of different vertex types.} \item{k}{The number of trials per time step, see details below.} diff --git a/man/forest.fire.game.Rd b/man/forest.fire.game.Rd index 574211f1df1..180d6a879d0 100644 --- a/man/forest.fire.game.Rd +++ b/man/forest.fire.game.Rd @@ -7,8 +7,6 @@ forest.fire.game(nodes, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE) } \arguments{ -\item{nodes}{The number of vertices in the graph.} - \item{fw.prob}{The forward burning probability, see details below.} \item{bw.factor}{The backward burning ratio. The backward burning diff --git a/man/grg.game.Rd b/man/grg.game.Rd index 4c430f572d5..20a0895322b 100644 --- a/man/grg.game.Rd +++ b/man/grg.game.Rd @@ -7,8 +7,6 @@ grg.game(nodes, radius, torus = FALSE, coords = FALSE) } \arguments{ -\item{nodes}{The number of vertices in the graph.} - \item{radius}{The radius within which the vertices will be connected by an edge.} diff --git a/man/preference.game.Rd b/man/preference.game.Rd index 2cd83f95a8c..5453e80a4c4 100644 --- a/man/preference.game.Rd +++ b/man/preference.game.Rd @@ -15,8 +15,6 @@ preference.game( ) } \arguments{ -\item{nodes}{The number of vertices in the graphs.} - \item{types}{The number of different vertex types.} \item{type.dist}{The distribution of the vertex types, a numeric vector of diff --git a/man/sample_forestfire.Rd b/man/sample_forestfire.Rd index 76eff55ac99..378df20da1c 100644 --- a/man/sample_forestfire.Rd +++ b/man/sample_forestfire.Rd @@ -4,10 +4,10 @@ \alias{sample_forestfire} \title{Forest Fire Network Model} \usage{ -sample_forestfire(nodes, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE) +sample_forestfire(n, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE) } \arguments{ -\item{nodes}{The number of vertices in the graph.} +\item{n}{The number of vertices in the graph.} \item{fw.prob}{The forward burning probability, see details below.} diff --git a/man/sample_grg.Rd b/man/sample_grg.Rd index 009fcf6f650..89ae93047ca 100644 --- a/man/sample_grg.Rd +++ b/man/sample_grg.Rd @@ -5,12 +5,12 @@ \alias{grg} \title{Geometric random graphs} \usage{ -sample_grg(nodes, radius, torus = FALSE, coords = FALSE) +sample_grg(n, radius, torus = FALSE, coords = FALSE) grg(...) } \arguments{ -\item{nodes}{The number of vertices in the graph.} +\item{n}{The number of vertices in the graph.} \item{radius}{The radius within which the vertices will be connected by an edge.} diff --git a/man/sample_pref.Rd b/man/sample_pref.Rd index 43aadaa2faa..2aee8e1a4b5 100644 --- a/man/sample_pref.Rd +++ b/man/sample_pref.Rd @@ -8,7 +8,7 @@ \title{Trait-based random generation} \usage{ sample_pref( - nodes, + n, types, type.dist = rep(1, types), fixed.sizes = FALSE, @@ -20,7 +20,7 @@ sample_pref( pref(...) sample_asym_pref( - nodes, + n, types, type.dist.matrix = matrix(1, types, types), pref.matrix = matrix(1, types, types), @@ -30,7 +30,7 @@ sample_asym_pref( asym_pref(...) } \arguments{ -\item{nodes}{The number of vertices in the graphs.} +\item{n}{The number of vertices in the graphs.} \item{types}{The number of different vertex types.} diff --git a/man/sample_traits_callaway.Rd b/man/sample_traits_callaway.Rd index 7d7886783e0..31ebfa1bba4 100644 --- a/man/sample_traits_callaway.Rd +++ b/man/sample_traits_callaway.Rd @@ -8,7 +8,7 @@ \title{Graph generation based on different vertex types} \usage{ sample_traits_callaway( - nodes, + n, types, edge.per.step = 1, type.dist = rep(1, types), @@ -19,7 +19,7 @@ sample_traits_callaway( traits_callaway(...) sample_traits( - nodes, + n, types, k = 1, type.dist = rep(1, types), @@ -30,7 +30,7 @@ sample_traits( traits(...) } \arguments{ -\item{nodes}{The number of vertices in the graph.} +\item{n}{The number of vertices in the graph.} \item{types}{The number of different vertex types.} From 457cd86c0d617fc512e200d02818e2c5873aebff Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 23:53:36 +0000 Subject: [PATCH 3/4] Rename 'nodes' to 'vertices' in centrality and structural functions Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com> --- R/centrality.R | 24 ++++++++++++------------ R/structural-properties.R | 24 ++++++++++++------------ man/alpha.centrality.Rd | 4 ---- man/alpha_centrality.Rd | 4 ++-- man/bonpow.Rd | 3 --- man/constraint.Rd | 4 ++-- man/ego.Rd | 14 +++++++------- man/graph.neighborhood.Rd | 2 -- man/neighborhood.size.Rd | 2 -- man/page.rank.Rd | 2 -- man/page_rank.Rd | 4 ++-- man/power_centrality.Rd | 4 ++-- 12 files changed, 39 insertions(+), 52 deletions(-) diff --git a/R/centrality.R b/R/centrality.R index fec7751b215..7d6c107ddfe 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -43,7 +43,7 @@ page.rank <- function( page_rank( graph = graph, algo = algo, - vids = vids, + vertices = vids, directed = directed, damping = damping, personalized = personalized, @@ -255,7 +255,7 @@ bonpow <- function( lifecycle::deprecate_soft("2.0.0", "bonpow()", "power_centrality()") power_centrality( graph = graph, - nodes = nodes, + vertices = nodes, loops = loops, exponent = exponent, rescale = rescale, @@ -288,7 +288,7 @@ alpha.centrality <- function( lifecycle::deprecate_soft("2.0.0", "alpha.centrality()", "alpha_centrality()") alpha_centrality( graph = graph, - nodes = nodes, + vertices = nodes, alpha = alpha, loops = loops, exo = exo, @@ -1653,7 +1653,7 @@ hub_score <- function( #' for all but small graphs. `"arpack"` uses the ARPACK library, the #' default implementation from igraph version 0.5 until version 0.7. It computes #' PageRank scores by solving an eingevalue problem. -#' @param vids The vertices of interest. +#' @param vertices The vertices of interest. #' @param directed Logical, if true directed paths will be considered for #' directed graphs. It is ignored for undirected graphs. #' @param damping The damping factor (\sQuote{d} in the original paper). @@ -1714,7 +1714,7 @@ hub_score <- function( page_rank <- function( graph, algo = c("prpack", "arpack"), - vids = V(graph), + vertices = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, @@ -1724,7 +1724,7 @@ page_rank <- function( personalized_pagerank_impl( graph = graph, algo = algo, - vids = vids, + vids = vertices, directed = directed, damping = damping, personalized = personalized, @@ -1914,7 +1914,7 @@ bonpow.sparse <- function( #' is important to think about the edge direction and what it represents. #' #' @param graph the input graph. -#' @param nodes vertex sequence indicating which vertices are to be included in +#' @param vertices vertex sequence indicating which vertices are to be included in #' the calculation. By default, all vertices are included. #' @param loops boolean indicating whether or not the diagonal should be #' treated as valid data. Set this true if and only if the data can contain @@ -1975,14 +1975,14 @@ bonpow.sparse <- function( #' power_centrality <- function( graph, - nodes = V(graph), + vertices = V(graph), loops = FALSE, exponent = 1, rescale = FALSE, tol = 1e-7, sparse = TRUE ) { - nodes <- as_igraph_vs(graph, nodes) + nodes <- as_igraph_vs(graph, vertices) if (sparse) { res <- bonpow.sparse(graph, nodes, loops, exponent, rescale, tol) } else { @@ -2114,7 +2114,7 @@ alpha.centrality.sparse <- function( #' #' @param graph The input graph, can be directed or undirected. In undirected #' graphs, edges are treated as if they were reciprocal directed ones. -#' @param nodes Vertex sequence, the vertices for which the alpha centrality +#' @param vertices Vertex sequence, the vertices for which the alpha centrality #' values are returned. (For technical reasons they will be calculated for all #' vertices, anyway.) #' @param alpha Parameter specifying the relative importance of endogenous @@ -2160,7 +2160,7 @@ alpha.centrality.sparse <- function( #' alpha_centrality <- function( graph, - nodes = V(graph), + vertices = V(graph), alpha = 1, loops = FALSE, exo = 1, @@ -2168,7 +2168,7 @@ alpha_centrality <- function( tol = 1e-7, sparse = TRUE ) { - nodes <- as_igraph_vs(graph, nodes) + nodes <- as_igraph_vs(graph, vertices) if (sparse) { res <- alpha.centrality.sparse( graph, diff --git a/R/structural-properties.R b/R/structural-properties.R index cd56b513890..b1e34e19c4c 100644 --- a/R/structural-properties.R +++ b/R/structural-properties.R @@ -184,7 +184,7 @@ neighborhood.size <- function( ego_size( graph = graph, order = order, - nodes = nodes, + vertices = nodes, mode = mode, mindist = mindist ) @@ -378,7 +378,7 @@ graph.neighborhood <- function( make_ego_graph( graph = graph, order = order, - nodes = nodes, + vertices = nodes, mode = mode, mindist = mindist ) @@ -1899,7 +1899,7 @@ transitivity <- function( #' graph adjacency matrix. For isolated vertices, constraint is undefined. #' #' @param graph A graph object, the input graph. -#' @param nodes The vertices for which the constraint will be calculated. +#' @param vertices The vertices for which the constraint will be calculated. #' Defaults to all vertices. #' @param weights The weights of the edges. If this is `NULL` and there is #' a `weight` edge attribute this is used. If there is no such edge @@ -1918,9 +1918,9 @@ transitivity <- function( #' g <- sample_gnp(20, 5 / 20) #' constraint(g) #' -constraint <- function(graph, nodes = V(graph), weights = NULL) { +constraint <- function(graph, vertices = V(graph), weights = NULL) { ensure_igraph(graph) - nodes <- as_igraph_vs(graph, nodes) + nodes <- as_igraph_vs(graph, vertices) if (is.null(weights)) { if ("weight" %in% edge_attr_names(graph)) { @@ -2034,7 +2034,7 @@ edge_density <- function(graph, loops = FALSE) { ego_size <- function( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) { @@ -2047,7 +2047,7 @@ ego_size <- function( .Call( R_igraph_neighborhood_size, graph, - as_igraph_vs(graph, nodes) - 1, + as_igraph_vs(graph, vertices) - 1, as.numeric(order), as.numeric(mode), mindist @@ -2090,7 +2090,7 @@ neighborhood_size <- ego_size #' @param graph The input graph. #' @param order Integer giving the order of the neighborhood. Negative values #' indicate an infinite order. -#' @param nodes The vertices for which the calculation is performed. +#' @param vertices The vertices for which the calculation is performed. #' @param mode Character constant, it specifies how to use the direction of #' the edges if a directed graph is analyzed. For \sQuote{out} only the #' outgoing edges are followed, so all vertices reachable from the source @@ -2148,7 +2148,7 @@ neighborhood_size <- ego_size ego <- function( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) { @@ -2161,7 +2161,7 @@ ego <- function( res <- .Call( R_igraph_neighborhood, graph, - as_igraph_vs(graph, nodes) - 1, + as_igraph_vs(graph, vertices) - 1, as.numeric(order), as.numeric(mode), mindist @@ -2183,7 +2183,7 @@ neighborhood <- ego make_ego_graph <- function( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) { @@ -2196,7 +2196,7 @@ make_ego_graph <- function( res <- .Call( R_igraph_neighborhood_graphs, graph, - as_igraph_vs(graph, nodes) - 1, + as_igraph_vs(graph, vertices) - 1, as.numeric(order), as.integer(mode), mindist diff --git a/man/alpha.centrality.Rd b/man/alpha.centrality.Rd index 530eedc75c4..a4fd36b81a1 100644 --- a/man/alpha.centrality.Rd +++ b/man/alpha.centrality.Rd @@ -19,10 +19,6 @@ alpha.centrality( \item{graph}{The input graph, can be directed or undirected. In undirected graphs, edges are treated as if they were reciprocal directed ones.} -\item{nodes}{Vertex sequence, the vertices for which the alpha centrality -values are returned. (For technical reasons they will be calculated for all -vertices, anyway.)} - \item{alpha}{Parameter specifying the relative importance of endogenous versus exogenous factors in the determination of centrality. See details below.} diff --git a/man/alpha_centrality.Rd b/man/alpha_centrality.Rd index b41a3223e03..3d732ec28f2 100644 --- a/man/alpha_centrality.Rd +++ b/man/alpha_centrality.Rd @@ -6,7 +6,7 @@ \usage{ alpha_centrality( graph, - nodes = V(graph), + vertices = V(graph), alpha = 1, loops = FALSE, exo = 1, @@ -19,7 +19,7 @@ alpha_centrality( \item{graph}{The input graph, can be directed or undirected. In undirected graphs, edges are treated as if they were reciprocal directed ones.} -\item{nodes}{Vertex sequence, the vertices for which the alpha centrality +\item{vertices}{Vertex sequence, the vertices for which the alpha centrality values are returned. (For technical reasons they will be calculated for all vertices, anyway.)} diff --git a/man/bonpow.Rd b/man/bonpow.Rd index 4377272047a..1830d90750b 100644 --- a/man/bonpow.Rd +++ b/man/bonpow.Rd @@ -17,9 +17,6 @@ bonpow( \arguments{ \item{graph}{the input graph.} -\item{nodes}{vertex sequence indicating which vertices are to be included in -the calculation. By default, all vertices are included.} - \item{loops}{boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops. \code{loops} is \code{FALSE} by default.} diff --git a/man/constraint.Rd b/man/constraint.Rd index ae337644aa5..542d4fdee56 100644 --- a/man/constraint.Rd +++ b/man/constraint.Rd @@ -4,12 +4,12 @@ \alias{constraint} \title{Burt's constraint} \usage{ -constraint(graph, nodes = V(graph), weights = NULL) +constraint(graph, vertices = V(graph), weights = NULL) } \arguments{ \item{graph}{A graph object, the input graph.} -\item{nodes}{The vertices for which the constraint will be calculated. +\item{vertices}{The vertices for which the constraint will be calculated. Defaults to all vertices.} \item{weights}{The weights of the edges. If this is \code{NULL} and there is diff --git a/man/ego.Rd b/man/ego.Rd index 69c018240fe..15437e92066 100644 --- a/man/ego.Rd +++ b/man/ego.Rd @@ -16,7 +16,7 @@ connect(graph, order, mode = c("all", "out", "in", "total")) ego_size( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -24,7 +24,7 @@ ego_size( neighborhood_size( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -32,7 +32,7 @@ neighborhood_size( ego( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -40,7 +40,7 @@ ego( neighborhood( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -48,7 +48,7 @@ neighborhood( make_ego_graph( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -56,7 +56,7 @@ make_ego_graph( make_neighborhood_graph( graph, order = 1, - nodes = V(graph), + vertices = V(graph), mode = c("all", "out", "in"), mindist = 0 ) @@ -75,7 +75,7 @@ vertices from which the source vertex is reachable in at most \code{order} steps are counted. \sQuote{"all"} ignores the direction of the edges. This argument is ignored for undirected graphs.} -\item{nodes}{The vertices for which the calculation is performed.} +\item{vertices}{The vertices for which the calculation is performed.} \item{mindist}{The minimum distance to include the vertex in the result.} } diff --git a/man/graph.neighborhood.Rd b/man/graph.neighborhood.Rd index 5e322a65d4b..f013c37a900 100644 --- a/man/graph.neighborhood.Rd +++ b/man/graph.neighborhood.Rd @@ -18,8 +18,6 @@ graph.neighborhood( \item{order}{Integer giving the order of the neighborhood. Negative values indicate an infinite order.} -\item{nodes}{The vertices for which the calculation is performed.} - \item{mode}{Character constant, it specifies how to use the direction of the edges if a directed graph is analyzed. For \sQuote{out} only the outgoing edges are followed, so all vertices reachable from the source diff --git a/man/neighborhood.size.Rd b/man/neighborhood.size.Rd index b52295c6916..7e9aae8cf08 100644 --- a/man/neighborhood.size.Rd +++ b/man/neighborhood.size.Rd @@ -18,8 +18,6 @@ neighborhood.size( \item{order}{Integer giving the order of the neighborhood. Negative values indicate an infinite order.} -\item{nodes}{The vertices for which the calculation is performed.} - \item{mode}{Character constant, it specifies how to use the direction of the edges if a directed graph is analyzed. For \sQuote{out} only the outgoing edges are followed, so all vertices reachable from the source diff --git a/man/page.rank.Rd b/man/page.rank.Rd index 69075bee792..cf0452c3e7b 100644 --- a/man/page.rank.Rd +++ b/man/page.rank.Rd @@ -27,8 +27,6 @@ for all but small graphs. \code{"arpack"} uses the ARPACK library, the default implementation from igraph version 0.5 until version 0.7. It computes PageRank scores by solving an eingevalue problem.} -\item{vids}{The vertices of interest.} - \item{directed}{Logical, if true directed paths will be considered for directed graphs. It is ignored for undirected graphs.} diff --git a/man/page_rank.Rd b/man/page_rank.Rd index 182032cf711..df7f1522378 100644 --- a/man/page_rank.Rd +++ b/man/page_rank.Rd @@ -7,7 +7,7 @@ page_rank( graph, algo = c("prpack", "arpack"), - vids = V(graph), + vertices = V(graph), directed = TRUE, damping = 0.85, personalized = NULL, @@ -27,7 +27,7 @@ for all but small graphs. \code{"arpack"} uses the ARPACK library, the default implementation from igraph version 0.5 until version 0.7. It computes PageRank scores by solving an eingevalue problem.} -\item{vids}{The vertices of interest.} +\item{vertices}{The vertices of interest.} \item{directed}{Logical, if true directed paths will be considered for directed graphs. It is ignored for undirected graphs.} diff --git a/man/power_centrality.Rd b/man/power_centrality.Rd index aeb2c85dd24..df37ede746c 100644 --- a/man/power_centrality.Rd +++ b/man/power_centrality.Rd @@ -6,7 +6,7 @@ \usage{ power_centrality( graph, - nodes = V(graph), + vertices = V(graph), loops = FALSE, exponent = 1, rescale = FALSE, @@ -17,7 +17,7 @@ power_centrality( \arguments{ \item{graph}{the input graph.} -\item{nodes}{vertex sequence indicating which vertices are to be included in +\item{vertices}{vertex sequence indicating which vertices are to be included in the calculation. By default, all vertices are included.} \item{loops}{boolean indicating whether or not the diagonal should be From 1cb98aad895532b05ed510ffc80826e7cc0a7146 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Oct 2025 23:58:03 +0000 Subject: [PATCH 4/4] Rename 'vids' to 'vertices' in additional centrality and path functions Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com> --- R/centrality.R | 26 +++++++++++++------------- R/paths.R | 6 +++--- man/closeness.Rd | 4 ++-- man/diversity.Rd | 4 ++-- man/eccentricity.Rd | 4 ++-- man/estimate_closeness.Rd | 2 -- man/graph.diversity.Rd | 2 -- man/graph.strength.Rd | 2 -- man/harmonic_centrality.Rd | 4 ++-- man/strength.Rd | 4 ++-- 10 files changed, 26 insertions(+), 32 deletions(-) diff --git a/R/centrality.R b/R/centrality.R index 7d6c107ddfe..0ae4c7867d4 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -120,7 +120,7 @@ graph.strength <- function( lifecycle::deprecate_soft("2.0.0", "graph.strength()", "strength()") strength( graph = graph, - vids = vids, + vertices = vids, mode = mode, loops = loops, weights = weights @@ -543,7 +543,7 @@ edge.betweenness.estimate <- estimate_edge_betweenness #' #' @aliases closeness.estimate #' @param graph The graph to analyze. -#' @param vids The vertices for which closeness will be calculated. +#' @param vertices The vertices for which closeness will be calculated. #' @param mode Character string, defined the types of the paths used for #' measuring the distance in directed graphs. \dQuote{in} measures the paths #' *to* a vertex, \dQuote{out} measures paths *from* a vertex, @@ -578,7 +578,7 @@ edge.betweenness.estimate <- estimate_edge_betweenness #' closeness <- function( graph, - vids = V(graph), + vertices = V(graph), mode = c("out", "in", "all", "total"), weights = NULL, normalized = FALSE, @@ -587,7 +587,7 @@ closeness <- function( # Argument checks ensure_igraph(graph) - vids <- as_igraph_vs(graph, vids) + vids <- as_igraph_vs(graph, vertices) mode <- switch( igraph.match.arg(mode), "out" = 1, @@ -1370,7 +1370,7 @@ eigen_centrality <- function( #' #' #' @param graph The input graph. -#' @param vids The vertices for which the strength will be calculated. +#' @param vertices The vertices for which the strength will be calculated. #' @param mode Character string, \dQuote{out} for out-degree, \dQuote{in} for #' in-degree or \dQuote{all} for the sum of the two. For undirected graphs this #' argument is ignored. @@ -1403,14 +1403,14 @@ eigen_centrality <- function( #' @cdocs igraph_strength strength <- function( graph, - vids = V(graph), + vertices = V(graph), mode = c("all", "out", "in", "total"), loops = TRUE, weights = NULL ) { strength_impl( graph = graph, - vids = vids, + vids = vertices, mode = mode, loops = loops, weights = weights @@ -1439,7 +1439,7 @@ strength <- function( #' @param weights `NULL`, or the vector of edge weights to use for the #' computation. If `NULL`, then the \sQuote{weight} attibute is used. Note #' that this measure is not defined for unweighted graphs. -#' @param vids The vertex ids for which to calculate the measure. +#' @param vertices The vertex ids for which to calculate the measure. #' @return A numeric vector, its length is the number of vertices. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @references Nathan Eagle, Michael Macy and Rob Claxton: Network Diversity @@ -1459,11 +1459,11 @@ strength <- function( #' @family centrality #' @export #' @cdocs igraph_diversity -diversity <- function(graph, weights = NULL, vids = V(graph)) { +diversity <- function(graph, weights = NULL, vertices = V(graph)) { diversity_impl( graph = graph, weights = weights, - vids = vids + vids = vertices ) } @@ -1744,7 +1744,7 @@ page_rank <- function( #' default), then the function calculates the exact harmonic centrality scores. #' #' @param graph The graph to analyze. -#' @param vids The vertices for which harmonic centrality will be calculated. +#' @param vertices The vertices for which harmonic centrality will be calculated. #' @param mode Character string, defining the types of the paths used for #' measuring the distance in directed graphs. \dQuote{out} follows paths along #' the edge directions only, \dQuote{in} traverses the edges in reverse, while @@ -1781,7 +1781,7 @@ page_rank <- function( #' @cdocs igraph_harmonic_centrality_cutoff harmonic_centrality <- function( graph, - vids = V(graph), + vertices = V(graph), mode = c("out", "in", "all", "total"), weights = NULL, normalized = FALSE, @@ -1789,7 +1789,7 @@ harmonic_centrality <- function( ) { harmonic_centrality_cutoff_impl( graph = graph, - vids = vids, + vids = vertices, mode = mode, weights = weights, normalized = normalized, diff --git a/R/paths.R b/R/paths.R index 972bcc136b7..b752413ebfa 100644 --- a/R/paths.R +++ b/R/paths.R @@ -268,7 +268,7 @@ max_cardinality <- function(graph) { #' Isolate vertices have eccentricity zero. #' #' @param graph The input graph, it can be directed or undirected. -#' @param vids The vertices for which the eccentricity is calculated. +#' @param vertices The vertices for which the eccentricity is calculated. #' @inheritParams distances #' @inheritParams rlang::args_dots_empty #' @return `eccentricity()` returns a numeric vector, containing the @@ -285,7 +285,7 @@ max_cardinality <- function(graph) { #' @cdocs igraph_eccentricity_dijkstra eccentricity <- function( graph, - vids = V(graph), + vertices = V(graph), ..., weights = NULL, mode = c("all", "out", "in", "total") @@ -308,7 +308,7 @@ eccentricity <- function( eccentricity_dijkstra_impl( graph = graph, - vids = vids, + vids = vertices, weights = weights, mode = mode ) diff --git a/man/closeness.Rd b/man/closeness.Rd index dc860d003ed..03b7dd709f8 100644 --- a/man/closeness.Rd +++ b/man/closeness.Rd @@ -7,7 +7,7 @@ \usage{ closeness( graph, - vids = V(graph), + vertices = V(graph), mode = c("out", "in", "all", "total"), weights = NULL, normalized = FALSE, @@ -17,7 +17,7 @@ closeness( \arguments{ \item{graph}{The graph to analyze.} -\item{vids}{The vertices for which closeness will be calculated.} +\item{vertices}{The vertices for which closeness will be calculated.} \item{mode}{Character string, defined the types of the paths used for measuring the distance in directed graphs. \dQuote{in} measures the paths diff --git a/man/diversity.Rd b/man/diversity.Rd index 570b68a7de6..3666b7b9d29 100644 --- a/man/diversity.Rd +++ b/man/diversity.Rd @@ -4,7 +4,7 @@ \alias{diversity} \title{Graph diversity} \usage{ -diversity(graph, weights = NULL, vids = V(graph)) +diversity(graph, weights = NULL, vertices = V(graph)) } \arguments{ \item{graph}{The input graph. Edge directions are ignored.} @@ -13,7 +13,7 @@ diversity(graph, weights = NULL, vids = V(graph)) computation. If \code{NULL}, then the \sQuote{weight} attibute is used. Note that this measure is not defined for unweighted graphs.} -\item{vids}{The vertex ids for which to calculate the measure.} +\item{vertices}{The vertex ids for which to calculate the measure.} } \value{ A numeric vector, its length is the number of vertices. diff --git a/man/eccentricity.Rd b/man/eccentricity.Rd index a4678a78d2d..e44d23c1ce5 100644 --- a/man/eccentricity.Rd +++ b/man/eccentricity.Rd @@ -6,7 +6,7 @@ \usage{ eccentricity( graph, - vids = V(graph), + vertices = V(graph), ..., weights = NULL, mode = c("all", "out", "in", "total") @@ -15,7 +15,7 @@ eccentricity( \arguments{ \item{graph}{The input graph, it can be directed or undirected.} -\item{vids}{The vertices for which the eccentricity is calculated.} +\item{vertices}{The vertices for which the eccentricity is calculated.} \item{...}{These dots are for future extensions and must be empty.} diff --git a/man/estimate_closeness.Rd b/man/estimate_closeness.Rd index 0441327d3b3..f136ea4d41c 100644 --- a/man/estimate_closeness.Rd +++ b/man/estimate_closeness.Rd @@ -16,8 +16,6 @@ estimate_closeness( \arguments{ \item{graph}{The graph to analyze.} -\item{vids}{The vertices for which closeness will be calculated.} - \item{mode}{Character string, defined the types of the paths used for measuring the distance in directed graphs. \dQuote{in} measures the paths \emph{to} a vertex, \dQuote{out} measures paths \emph{from} a vertex, diff --git a/man/graph.diversity.Rd b/man/graph.diversity.Rd index 02d7a817d65..e190f9d33ef 100644 --- a/man/graph.diversity.Rd +++ b/man/graph.diversity.Rd @@ -12,8 +12,6 @@ graph.diversity(graph, weights = NULL, vids = V(graph)) \item{weights}{\code{NULL}, or the vector of edge weights to use for the computation. If \code{NULL}, then the \sQuote{weight} attibute is used. Note that this measure is not defined for unweighted graphs.} - -\item{vids}{The vertex ids for which to calculate the measure.} } \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/graph.strength.Rd b/man/graph.strength.Rd index b0a556be306..073e9880837 100644 --- a/man/graph.strength.Rd +++ b/man/graph.strength.Rd @@ -15,8 +15,6 @@ graph.strength( \arguments{ \item{graph}{The input graph.} -\item{vids}{The vertices for which the strength will be calculated.} - \item{mode}{Character string, \dQuote{out} for out-degree, \dQuote{in} for in-degree or \dQuote{all} for the sum of the two. For undirected graphs this argument is ignored.} diff --git a/man/harmonic_centrality.Rd b/man/harmonic_centrality.Rd index c70629c847d..575e353db4d 100644 --- a/man/harmonic_centrality.Rd +++ b/man/harmonic_centrality.Rd @@ -6,7 +6,7 @@ \usage{ harmonic_centrality( graph, - vids = V(graph), + vertices = V(graph), mode = c("out", "in", "all", "total"), weights = NULL, normalized = FALSE, @@ -16,7 +16,7 @@ harmonic_centrality( \arguments{ \item{graph}{The graph to analyze.} -\item{vids}{The vertices for which harmonic centrality will be calculated.} +\item{vertices}{The vertices for which harmonic centrality will be calculated.} \item{mode}{Character string, defining the types of the paths used for measuring the distance in directed graphs. \dQuote{out} follows paths along diff --git a/man/strength.Rd b/man/strength.Rd index 76a2e34f9b6..07ac64f98b8 100644 --- a/man/strength.Rd +++ b/man/strength.Rd @@ -6,7 +6,7 @@ \usage{ strength( graph, - vids = V(graph), + vertices = V(graph), mode = c("all", "out", "in", "total"), loops = TRUE, weights = NULL @@ -15,7 +15,7 @@ strength( \arguments{ \item{graph}{The input graph.} -\item{vids}{The vertices for which the strength will be calculated.} +\item{vertices}{The vertices for which the strength will be calculated.} \item{mode}{Character string, \dQuote{out} for out-degree, \dQuote{in} for in-degree or \dQuote{all} for the sum of the two. For undirected graphs this