diff --git a/R/cliques.R b/R/cliques.R index 29fefbe4a6..5befee2376 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -381,7 +381,6 @@ max_cliques <- function( } #' @rdname cliques -#' @inheritParams rlang::args_dots_empty #' @export count_max_cliques <- function( graph, @@ -566,7 +565,6 @@ weighted_cliques <- function( maximal = maximal ) } -#' @inheritParams rlang::args_dots_empty #' @export #' @rdname cliques largest_weighted_cliques <- function( @@ -614,7 +612,6 @@ largest_weighted_cliques <- function( vertex_weights = vertex.weights ) } -#' @inheritParams rlang::args_dots_empty #' @export #' @rdname cliques weighted_clique_num <- function( @@ -799,7 +796,6 @@ ivs_size <- function(graph) { independence_number <- ivs_size #' @rdname cliques -#' @inheritParams rlang::args_dots_empty #' @export clique_size_counts <- function( graph, @@ -898,7 +894,6 @@ is_complete <- function(graph) { #' #' @param graph The input graph. #' @param candidate The vertex set to test for being a clique. -#' @inheritParams rlang::args_dots_empty #' @param directed Whether to consider edge directions. #' @return `is_clique()` returns `TRUE` if the candidate vertex set forms #' a clique. diff --git a/R/cohesive.blocks.R b/R/cohesive.blocks.R index 18eef59d2e..ce601cc1a2 100644 --- a/R/cohesive.blocks.R +++ b/R/cohesive.blocks.R @@ -224,7 +224,6 @@ blockGraphs <- function(blocks, graph) { #' For `graphs_from_cohesive_blocks()` and `export_pajek()` the same graph must be #' supplied whose cohesive block structure is given in the `blocks()` #' argument. -#' @inheritParams rlang::args_dots_empty #' @param labels Logical, whether to add the vertex labels to the result #' object. These labels can be then used when reporting and plotting the #' cohesive blocks. @@ -263,6 +262,8 @@ blockGraphs <- function(blocks, graph) { #' the Reingold-Tilford layout generator. #' @param \dots Additional arguments. `plot_hierarchy()` and [plot()] pass #' them to `plot.igraph()`. [print()] and [summary()] ignore them. +#' `cohesive_blocks()` and `export_pajek()` do not accept extra arguments; +#' these dots must be empty for them. #' @return `cohesive_blocks()` returns a `cohesiveBlocks` object. #' #' `blocks()` returns a list of numeric vectors, containing vertex IDs. @@ -632,7 +633,6 @@ exportPajek.cohesiveblocks.nopf <- function(blocks, graph, file) { } #' @rdname cohesive_blocks -#' @inheritParams rlang::args_dots_empty #' @export export_pajek <- function( blocks, diff --git a/R/community.R b/R/community.R index 783f767600..0989f11dcf 100644 --- a/R/community.R +++ b/R/community.R @@ -921,7 +921,9 @@ modularity <- function(x, ...) { #' 0. Set it to 1 to use the classical definition of modularity. #' @param directed Whether to use the directed or undirected version of #' modularity. Ignored for undirected graphs. -#' @param \dots Additional arguments, none currently. +#' @param \dots For `modularity_matrix()`, these dots must be empty. For +#' `modularity()`, unused, present for S3 method consistency but may be +#' used by other methods that implement it. #' @return For `modularity()` a numeric scalar, the modularity score of the #' given configuration. #' @@ -983,7 +985,6 @@ modularity.communities <- function(x, ...) { } #' @rdname modularity.igraph -#' @inheritParams rlang::args_dots_empty #' @export modularity_matrix <- function( graph, diff --git a/R/components.R b/R/components.R index e1ef087a95..bd11a59276 100644 --- a/R/components.R +++ b/R/components.R @@ -437,7 +437,6 @@ is_biconnected <- function(graph) { #' @rdname components -#' @inheritParams rlang::args_dots_empty #' @export largest_component <- function( graph, diff --git a/R/conversion.R b/R/conversion.R index 61791722a7..b5d16a311a 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -1932,7 +1932,8 @@ graph.data.frame <- function(d, directed = TRUE, vertices = NULL) { #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [graph_from_literal()] #' for another way to create graphs, [read.table()] to read in tables -#' from files. +#' from files. See [from_data_frame()] to build a lazy constructor +#' specification for [make_()] or [sample_()]. #' @keywords graphs #' @examples #' @@ -2077,8 +2078,40 @@ graph_from_data_frame <- function( g } -#' @rdname graph_from_data_frame -#' @param ... Passed to `graph_from_data_frame()`. +#' Constructor specifications for `graph_()`, `make_()` and `sample_()` +#' +#' @description +#' Each of these functions builds a lazy constructor specification for the +#' given graph constructor, to be used with [graph_()], [make_()] or +#' [sample_()]. The specification is only evaluated when the graph is actually +#' constructed, so it can be combined with constructor modifiers such as +#' [with_vertex_()] or [with_edge_()]. +#' +#' `from_data_frame()`, `from_edgelist()`, `tree()` and `degseq()` wrap +#' [graph_from_data_frame()], [graph_from_edgelist()], [make_tree()] (or +#' [sample_tree()]) and [sample_degseq()] (or [realize_degseq()]), +#' respectively. +#' +#' The other constructors have specification functions as well; they are +#' documented together with the constructor they wrap, e.g. `ring()` on the +#' [make_ring()] page. +#' +#' @param ... Forwarded to the corresponding constructor function. +#' @return An object of class `igraph_constructor_spec`. +#' @seealso [graph_()], [make_()] and [sample_()] to apply a constructor +#' specification. +#' @family constructor specifications +#' @keywords graphs +#' @rdname constructor_spec +#' @examples +#' # Pass a constructor specification to graph_(), make_() or sample_() +#' el <- cbind(1:5, c(2:5, 1)) +#' graph_(el, from_edgelist(directed = FALSE)) +#' +#' make_(tree(7)) +#' +#' # Specifications can be combined with constructor modifiers +#' make_(tree(7), with_vertex_(color = "red")) #' @export from_data_frame <- function(...) constructor_spec(graph_from_data_frame, ...) @@ -2098,6 +2131,8 @@ from_data_frame <- function(...) constructor_spec(graph_from_data_frame, ...) #' @inheritParams rlang::args_dots_empty #' @param directed Whether to create a directed graph. #' @return An igraph graph. +#' @seealso [from_edgelist()] to build a lazy constructor specification for +#' [make_()] or [sample_()]. #' #' @family deterministic constructors #' @export @@ -2172,7 +2207,6 @@ graph_from_edgelist <- function( res } -#' @rdname graph_from_edgelist -#' @param ... Passed to `graph_from_edgelist()`. +#' @rdname constructor_spec #' @export from_edgelist <- function(...) constructor_spec(graph_from_edgelist, ...) diff --git a/R/epi.R b/R/epi.R index ad2871cbde..450d57aa50 100644 --- a/R/epi.R +++ b/R/epi.R @@ -20,7 +20,6 @@ ################################################################### #' @rdname sir -#' @inheritParams rlang::args_dots_empty #' @export time_bins <- function( x, diff --git a/R/flow.R b/R/flow.R index ce14c85cd0..6f185ca6b8 100644 --- a/R/flow.R +++ b/R/flow.R @@ -521,7 +521,9 @@ min_cut <- function( #' can be `NULL`, see details below. #' @param target The ID of the target vertex, for `vertex_connectivity()` it #' can be `NULL`, see details below. -#' @inheritParams rlang::args_dots_empty +#' @param \dots For `vertex_connectivity()`, these dots must be empty. For +#' `cohesion()`, unused, present for S3 method consistency but may be used +#' by other methods that implement it. #' @param checks Logical. Whether to check that the graph is connected #' and also the degree of the vertices. If the graph is not (strongly) #' connected then the connectivity is obviously zero. Otherwise if the minimum @@ -529,8 +531,6 @@ min_cut <- function( #' perform these checks, as they can be done quickly compared to the #' connectivity calculation itself. They were suggested by Peter McMahan, #' thanks Peter. -#' @param ... Additional arguments passed to methods. Not used by `vertex_connectivity()` -#' directly but may be used by other methods that implement `cohesion()`. #' @return A scalar real value. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @references White, Douglas R and Frank Harary 2001. The Cohesiveness of diff --git a/R/games.R b/R/games.R index eda1cb03a2..c61ca99b11 100644 --- a/R/games.R +++ b/R/games.R @@ -1515,7 +1515,8 @@ random.graph.game <- function( #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso #' [simplify()] to get rid of the multiple and/or loops edges, -#' [realize_degseq()] for a deterministic variant. +#' [realize_degseq()] for a deterministic variant. See [degseq()] to build a +#' lazy constructor specification for [make_()] or [sample_()]. #' @family games #' @export #' @keywords graphs @@ -1738,10 +1739,10 @@ sample_degseq <- function( res } -#' @rdname sample_degseq -#' @param deterministic Whether the construction should be deterministic -#' @param ... Passed to `realize_degseq()` if \sQuote{deterministic} is true, -#' or to `sample_degseq()` otherwise. +#' @rdname constructor_spec +#' @param deterministic For `degseq()`, whether the construction should be +#' deterministic; if `TRUE`, wraps [realize_degseq()] instead of +#' [sample_degseq()]. #' @export degseq <- function(..., deterministic = FALSE) { constructor_spec( diff --git a/R/layout.R b/R/layout.R index 5c028fe895..8a252d8700 100644 --- a/R/layout.R +++ b/R/layout.R @@ -702,7 +702,8 @@ normalize <- function( #' @return A matrix with two columns and as many rows as the number of vertices #' in the input graph. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} -#' @seealso [layout_with_sugiyama()] +#' @seealso [layout_with_sugiyama()]. See [as_bipartite()] to build a lazy +#' layout specification for [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -779,8 +780,48 @@ layout_as_bipartite <- function( } -#' @rdname layout_as_bipartite -#' @param ... Arguments to pass to `layout_as_bipartite()`. +#' Layout specifications for `layout_()` and `add_layout_()` +#' +#' @description +#' Each of these functions builds a lazy layout specification for the given +#' layout function, to be used with [layout_()] or [add_layout_()]. The +#' specification is only evaluated when the layout is actually computed, so it +#' can be combined with layout modifiers such as [component_wise()] or +#' [normalize()]. +#' +#' `as_bipartite()`, `as_star()` and `as_tree()` wrap [layout_as_bipartite()], +#' [layout_as_star()] and [layout_as_tree()] respectively. `in_circle()`, +#' `nicely()`, `on_grid()`, `on_sphere()` and `randomly()` wrap +#' [layout_in_circle()], [layout_nicely()], [layout_on_grid()], +#' [layout_on_sphere()] and [layout_randomly()]. `with_dh()`, `with_fr()`, +#' `with_gem()`, `with_graphopt()`, `with_kk()`, `with_lgl()`, `with_mds()`, +#' `with_sugiyama()` and `with_drl()` wrap [layout_with_dh()], +#' [layout_with_fr()], [layout_with_gem()], [layout_with_graphopt()], +#' [layout_with_kk()], [layout_with_lgl()], [layout_with_mds()], +#' [layout_with_sugiyama()] and [layout_with_drl()]. +#' +#' @param ... Forwarded to the corresponding `layout_*()` function. +#' @return An object of class `igraph_layout_spec`. +#' @seealso [layout_()] and [add_layout_()] to apply a layout specification +#' to a graph. +#' @family layout specifications +#' @keywords graphs +#' @rdname layout_spec +#' @examples +#' g <- make_ring(10) +#' +#' # Pass a layout specification to layout_() ... +#' layout_(g, in_circle()) +#' +#' # ... or store the layout in the graph with add_layout_() +#' g <- add_layout_(g, with_fr()) +#' g$layout +#' +#' # Specifications take the arguments of the layout function they wrap +#' layout_(make_star(10), as_star(center = 5)) +#' +#' # and can be combined with layout modifiers +#' layout_(make_ring(10) + make_ring(5), with_fr(), component_wise()) #' @export as_bipartite <- function(...) layout_spec(layout_as_bipartite, ...) @@ -806,7 +847,8 @@ as_bipartite <- function(...) layout_spec(layout_as_bipartite, ...) #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [layout()] and [layout_with_drl()] for other layout #' algorithms, [plot.igraph()] and [tkplot()] on how to -#' plot graphs and [star()] on how to create ring graphs. +#' plot graphs and [star()] on how to create ring graphs. See [as_star()] to +#' build a lazy layout specification for [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -879,8 +921,7 @@ layout_as_star <- function( } -#' @rdname layout_as_star -#' @param ... Arguments to pass to `layout_as_star()`. +#' @rdname layout_spec #' @export as_star <- function(...) layout_spec(layout_as_star, ...) @@ -928,6 +969,8 @@ as_star <- function(...) layout_spec(layout_as_star, ...) #' \email{csardi.gabor@@gmail.com} #' @references Reingold, E and Tilford, J (1981). Tidier drawing of trees. #' *IEEE Trans. on Softw. Eng.*, SE-7(2):223--228. +#' @seealso [as_tree()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1027,8 +1070,7 @@ layout_as_tree <- function( } -#' @rdname layout_as_tree -#' @param ... Passed to `layout_as_tree()`. +#' @rdname layout_spec #' @export as_tree <- function(...) layout_spec(layout_as_tree, ...) @@ -1068,6 +1110,8 @@ layout.reingold.tilford <- function(..., params = list()) { #' IDs. #' @return A numeric matrix with two columns, and one row for each vertex. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @seealso [in_circle()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1098,8 +1142,7 @@ layout_in_circle <- function(graph, order = NULL) { ) } -#' @rdname layout_in_circle -#' @param ... Passed to `layout_in_circle()`. +#' @rdname layout_spec #' @export in_circle <- function(...) layout_spec(layout_in_circle, ...) @@ -1159,12 +1202,12 @@ layout.circle <- function(..., params = list()) { #' #' @param graph The input graph #' @param dim Dimensions, should be 2 or 3. -#' @param \dots For `layout_nicely()` the extra arguments are passed to -#' the real layout function. For `nicely()` all argument are passed to -#' `layout_nicely()`. +#' @param \dots Extra arguments are passed to the real layout function that +#' `layout_nicely()` ends up calling. #' @return A numeric matrix with two or three columns. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} -#' @seealso [plot.igraph()] +#' @seealso [plot.igraph()]. See [nicely()] to build a lazy layout +#' specification for [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1230,7 +1273,7 @@ layout_nicely <- function(graph, dim = 2, ...) { } -#' @rdname layout_nicely +#' @rdname layout_spec #' @export nicely <- function(...) layout_spec(layout_nicely, ...) @@ -1258,7 +1301,8 @@ nicely <- function(...) layout_spec(layout_nicely, ...) #' @param dim Two or three. Whether to make 2d or a 3d layout. #' @return A two-column or three-column matrix. #' @author Tamas Nepusz \email{ntamas@@gmail.com} -#' @seealso [layout()] for other layout generators +#' @seealso [layout()] for other layout generators. See [on_grid()] to build +#' a lazy layout specification for [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1345,8 +1389,7 @@ layout_on_grid <- function( } -#' @rdname layout_on_grid -#' @param ... Passed to `layout_on_grid()`. +#' @rdname layout_spec #' @export on_grid <- function(...) layout_spec(layout_on_grid, ...) ## ---------------------------------------------------------------- @@ -1366,6 +1409,8 @@ on_grid <- function(...) layout_spec(layout_on_grid, ...) #' @param graph The input graph. #' @return A numeric matrix with three columns, and one row for each vertex. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @seealso [on_sphere()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1377,8 +1422,7 @@ layout_on_sphere <- function(graph) { } -#' @rdname layout_on_sphere -#' @param ... Passed to `layout_on_sphere()`. +#' @rdname layout_spec #' @export on_sphere <- function(...) layout_spec(layout_on_sphere, ...) @@ -1414,6 +1458,8 @@ layout.sphere <- function(..., params = list()) { #' or 3. #' @return A numeric matrix with two or three columns. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @seealso [randomly()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -1472,8 +1518,7 @@ layout_randomly <- function( } } -#' @rdname layout_randomly -#' @param ... Parameters to pass to `layout_randomly()`. +#' @rdname layout_spec #' @export randomly <- function(...) layout_spec(layout_randomly, ...) @@ -1550,7 +1595,8 @@ layout.random <- function(..., params = list()) { #' } #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [layout_with_fr()], -#' [layout_with_kk()] for other layout algorithms. +#' [layout_with_kk()] for other layout algorithms. See [with_dh()] to build a +#' lazy layout specification for [add_layout_()]. #' @references Ron Davidson, David Harel: Drawing Graphs Nicely Using Simulated #' Annealing. *ACM Transactions on Graphics* 15(4), pp. 301-331, 1996. #' @export @@ -1711,8 +1757,7 @@ layout_with_dh <- function( } -#' @rdname layout_with_dh -#' @param ... Passed to `layout_with_dh()`. +#' @rdname layout_spec #' @export with_dh <- function(...) layout_spec(layout_with_dh, ...) @@ -1771,7 +1816,8 @@ with_dh <- function(...) layout_spec(layout_with_dh, ...) #' vertex, according to the IDs of the vertex IDs. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [layout_with_drl()], [layout_with_kk()] for -#' other layout algorithms. +#' other layout algorithms. See [with_fr()] to build a lazy layout +#' specification for [add_layout_()]. #' @references Fruchterman, T.M.J. and Reingold, E.M. (1991). Graph Drawing by #' Force-directed Placement. *Software - Practice and Experience*, #' 21(11):1129-1164. @@ -1988,8 +2034,7 @@ layout_with_fr <- function( } -#' @rdname layout_with_fr -#' @param ... Passed to `layout_with_fr()`. +#' @rdname layout_spec #' @export with_fr <- function(...) layout_spec(layout_with_fr, ...) @@ -2040,7 +2085,8 @@ layout.fruchterman.reingold <- function(..., params = list()) { #' vertices. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [layout_with_fr()], -#' [plot.igraph()], [tkplot()] +#' [plot.igraph()], [tkplot()]. See [with_gem()] to build a lazy layout +#' specification for [add_layout_()]. #' @references Arne Frick, Andreas Ludwig, Heiko Mehldau: A Fast Adaptive #' Layout Algorithm for Undirected Graphs, *Proc. Graph Drawing 1994*, #' LNCS 894, pp. 388-403, 1995. @@ -2136,8 +2182,7 @@ layout_with_gem <- function( } -#' @rdname layout_with_gem -#' @param ... Passed to `layout_with_gem()`. +#' @rdname layout_spec #' @export with_gem <- function(...) layout_spec(layout_with_gem, ...) @@ -2182,6 +2227,8 @@ with_gem <- function(...) layout_spec(layout_with_gem, ...) #' @return A numeric matrix with two columns, and a row for each vertex. #' @author Michael Schmuhl for the original graphopt code, rewritten and #' wrapped by Gabor Csardi \email{csardi.gabor@@gmail.com}. +#' @seealso [with_graphopt()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -2269,8 +2316,7 @@ layout_with_graphopt <- function( } -#' @rdname layout_with_graphopt -#' @param ... Passed to `layout_with_graphopt()`. +#' @rdname layout_spec #' @export with_graphopt <- function(...) layout_spec(layout_with_graphopt, ...) @@ -2328,7 +2374,8 @@ with_graphopt <- function(...) layout_spec(layout_with_graphopt, ...) #' of the vertices. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [layout_with_drl()], [plot.igraph()], -#' [tkplot()] +#' [tkplot()]. See [with_kk()] to build a lazy layout specification for +#' [add_layout_()]. #' @references Kamada, T. and Kawai, S.: An Algorithm for Drawing General #' Undirected Graphs. *Information Processing Letters*, 31/1, 7--15, 1989. #' @export @@ -2533,10 +2580,8 @@ layout_with_kk <- function( } -#' @rdname layout_with_kk -#' @param ... Passed to `layout_with_kk()`. +#' @rdname layout_spec #' @export -#' with_kk <- function(...) layout_spec(layout_with_kk, ...) #' The Kamada-Kawai layout algorithm @@ -2586,6 +2631,8 @@ layout.kamada.kawai <- function(..., params = list()) { #' default value is -1 which means that a random vertex is selected. #' @return A numeric matrix with two columns and as many rows as vertices. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @seealso [with_lgl()] to build a lazy layout specification for +#' [add_layout_()]. #' @keywords graphs #' @export #' @family graph layouts @@ -2684,8 +2731,7 @@ layout_with_lgl <- function( } -#' @rdname layout_with_lgl -#' @param ... Passed to `layout_with_lgl()`. +#' @rdname layout_spec #' @export with_lgl <- function(...) layout_spec(layout_with_lgl, ...) @@ -2738,7 +2784,8 @@ layout.lgl <- function(..., params = list()) { #' @return A numeric matrix with `dim` columns. #' @author Tamas Nepusz \email{ntamas@@gmail.com} and Gabor Csardi #' \email{csardi.gabor@@gmail.com} -#' @seealso [layout()], [plot.igraph()] +#' @seealso [layout()], [plot.igraph()]. See [with_mds()] to build a lazy +#' layout specification for [add_layout_()]. #' @references Cox, T. F. and Cox, M. A. A. (2001) *Multidimensional #' Scaling*. Second edition. Chapman and Hall. #' @export @@ -2780,8 +2827,7 @@ layout_with_mds <- function( } -#' @rdname layout_with_mds -#' @param ... Passed to `layout_with_mds()`. +#' @rdname layout_spec #' @export with_mds <- function(...) layout_spec(layout_with_mds, ...) @@ -2852,6 +2898,8 @@ with_mds <- function(...) layout_spec(layout_with_mds, ...) #' } #' } #' @author Tamas Nepusz \email{ntamas@@gmail.com} +#' @seealso [with_sugiyama()] to build a lazy layout specification for +#' [add_layout_()]. #' @references K. Sugiyama, S. Tagawa and M. Toda, "Methods for Visual #' Understanding of Hierarchical Systems". IEEE Transactions on Systems, Man #' and Cybernetics 11(2):109-125, 1981. @@ -3166,8 +3214,7 @@ layout_with_sugiyama <- function( } -#' @rdname layout_with_sugiyama -#' @param ... Passed to `layout_with_sugiyama()`. +#' @rdname layout_spec #' @export with_sugiyama <- function(...) layout_spec(layout_with_sugiyama, ...) @@ -3198,13 +3245,13 @@ with_sugiyama <- function(...) layout_spec(layout_with_sugiyama, ...) #' #' @param graphs A list of graph objects. #' @param layouts A list of two-column matrices. -#' @inheritParams rlang::args_dots_empty #' @param method Character constant giving the method to use. Right now only #' `dla` is implemented. #' @param layout A function object, the layout function to use. The default #' `NULL` uses `layout_with_kk`. -#' @param \dots Additional arguments to pass to the `layout` layout -#' function. +#' @param \dots For `layout_components()`, additional arguments to pass to +#' the `layout` layout function. For `merge_coords()`, these dots must be +#' empty. #' @return A matrix with two columns and as many lines as the total number of #' vertices in the graphs. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} @@ -3623,7 +3670,8 @@ layout.drl <- function( #' @author Shawn Martin () #' and Gabor Csardi \email{csardi.gabor@@gmail.com} for the R/igraph interface #' and the three dimensional version. -#' @seealso [layout()] for other layout generators. +#' @seealso [layout()] for other layout generators. See [with_drl()] to +#' build a lazy layout specification for [add_layout_()]. #' @references See the following technical report: Martin, S., Brown, W.M., #' Klavans, R., Boyack, K.W., DrL: Distributed Recursive (Graph) Layout. SAND #' Reports, 2008. 2936: p. 1-10. @@ -3738,9 +3786,7 @@ layout_with_drl <- function( } -#' @rdname layout_with_drl -#' @param ... Passed to `layout_with_drl()`. -#' @family layout_drl +#' @rdname layout_spec #' @export with_drl <- function(...) layout_spec(layout_with_drl, ...) diff --git a/R/make.R b/R/make.R index 7f245ca01e..ec1f8fd648 100644 --- a/R/make.R +++ b/R/make.R @@ -2519,6 +2519,8 @@ wheel <- function( #' to their parents, while `undirected` creates an undirected #' graph. #' @return An igraph graph +#' @seealso [tree()] to build a lazy constructor specification for +#' [make_()] or [sample_()]. #' #' @family deterministic constructors #' @export @@ -2658,8 +2660,7 @@ sample_tree <- function( ) } -#' @rdname make_tree -#' @param ... Passed to `make_tree()` or `sample_tree()`. +#' @rdname constructor_spec #' @export tree <- function(...) { constructor_spec(list(make = make_tree, sample = sample_tree), ...) diff --git a/R/par.R b/R/par.R index a57b7e8f9d..0091dacfc6 100644 --- a/R/par.R +++ b/R/par.R @@ -195,23 +195,14 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose) #' } #' } #' -#' @aliases igraph_options igraph_opt #' @param \dots A list may be given as the only argument, or any number of #' arguments may be in the `name=value` form, or no argument at all may be #' given. See the Value and Details sections for explanation. -#' @param x A character string holding an option name. -#' @param default If the specified option is not set in the options list, this -#' value is returned. This facilitates retrieving an option and checking -#' whether it is set and setting it separately if not. -#' @return `igraph_options()` returns a list with the old values of the -#' updated parameters, invisibly. Without any arguments, it returns the -#' values of all options. -#' -#' For `igraph_opt()`, the current value set for option `x`, or -#' `NULL` if the option is unset. +#' @return A list with the old values of the updated parameters, invisibly. +#' Without any arguments, it returns the values of all options. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} -#' @seealso `igraph_options()` is similar to [options()] and -#' `igraph_opt()` is similar to [getOption()]. +#' @seealso Similar to [options()]. See [igraph_opt()] to retrieve the +#' value of a single option. #' @keywords graphs #' @examples #' @@ -294,9 +285,28 @@ get_all_options <- function() { res } -#' @rdname igraph_options +#' Query a single igraph parameter +#' +#' Retrieve the current value of one igraph option set via +#' [igraph_options()]. +#' +#' @param x A character string holding an option name. #' @inheritParams rlang::args_dots_empty +#' @param default If the specified option is not set in the options list, this +#' value is returned. This facilitates retrieving an option and checking +#' whether it is set and setting it separately if not. +#' @return The current value set for option `x`, or `NULL` if the option is +#' unset. +#' @author Gabor Csardi \email{csardi.gabor@@gmail.com} +#' @seealso Similar to [getOption()]. See [igraph_options()] to set options. +#' @keywords graphs +#' @examples +#' oldval <- igraph_opt("verbose") +#' igraph_options(verbose = TRUE) +#' layout_with_kk(make_ring(10)) +#' igraph_options(verbose = oldval) #' @export +#' @family igraph options igraph_opt <- function( x, ..., diff --git a/R/sir.R b/R/sir.R index faf5751585..efc2d8056c 100644 --- a/R/sir.R +++ b/R/sir.R @@ -53,7 +53,9 @@ #' @param gamma Positive scalar. The rate of recovery of an infected #' individual. Formally, this is the rate parameter of an exponential #' distribution. -#' @inheritParams rlang::args_dots_empty +#' @param \dots For `sir()` and `time_bins()`, these dots must be empty. For +#' `median.sir()` and `quantile.sir()`, unused, present for S3 method +#' consistency. #' @param no.sim Integer scalar, the number simulation runs to perform. #' @param x A `sir` object, returned by the `sir()` function. #' @param middle Logical, whether to return the middle of the time bins, @@ -66,7 +68,6 @@ #' for recovered. #' @param prob Numeric vector of probabilities, in \[0,1\], they specify the #' quantiles to calculate. -#' @param \dots Additional arguments, ignored currently. #' @return For `sir()` the results are returned in an object of class #' \sQuote{`sir`}, which is a list, with one element for each simulation. #' Each simulation is itself a list with the following elements. They are all diff --git a/R/structural-properties.R b/R/structural-properties.R index c2970ebc5a..6206c631c4 100644 --- a/R/structural-properties.R +++ b/R/structural-properties.R @@ -4147,12 +4147,12 @@ dfs <- function( #' depth-first searches. #' #' @param graph The graph to analyze. -#' @inheritParams rlang::args_dots_empty #' @param mode Character string, either \dQuote{weak} or \dQuote{strong}. For #' directed graphs \dQuote{weak} implies weakly, \dQuote{strong} strongly #' connected components to search. It is ignored for undirected graphs. -#' @param \dots Additional attributes to pass to `cluster`, right now only -#' `mode` makes sense. +#' @param \dots For `component_distribution()`, forwarded to `components()`. +#' For `components()`, `is_connected()`, `count_components()` and +#' `largest_component()`, these dots must be empty. #' @return For `is_connected()` a Logical. #' #' For `components()` a named list with three components: @@ -4246,7 +4246,6 @@ components <- function( } #' @rdname components -#' @inheritParams rlang::args_dots_empty #' @export is_connected <- function( graph, @@ -4295,7 +4294,6 @@ is_connected <- function( } #' @rdname components -#' @inheritParams rlang::args_dots_empty #' @export count_components <- function( graph, diff --git a/R/tkplot.R b/R/tkplot.R index 9342a28493..96934a4c80 100644 --- a/R/tkplot.R +++ b/R/tkplot.R @@ -276,8 +276,9 @@ assign(".next", 1, .tkplot.env) #' vertices, in absolute coordinates. #' @param degree The degree to rotate the plot. #' @param rad The degree to rotate the plot, in radian. -#' @param \dots Additional plotting parameters. See [igraph.plotting] for -#' the complete list. +#' @param \dots For `tkplot()`, additional plotting parameters, see +#' [igraph.plotting] for the complete list. For `tk_close()`, `tk_fit()`, +#' `tk_coords()` and `tk_rotate()`, these dots must be empty. #' @return `tkplot()` returns an integer, the ID of the plot, this can be #' used to manipulate it from the command line. #' @@ -527,7 +528,6 @@ tkplot <- function(graph, canvas.width = 450, canvas.height = 450, ...) { ################################################################### #' @rdname tkplot -#' @inheritParams rlang::args_dots_empty #' @export tk_close <- function( tkp.id, @@ -595,7 +595,6 @@ tk_off <- function() { } #' @rdname tkplot -#' @inheritParams rlang::args_dots_empty #' @export tk_fit <- function( tkp.id, @@ -729,7 +728,6 @@ tk_postscript <- function(tkp.id) { } #' @rdname tkplot -#' @inheritParams rlang::args_dots_empty #' @export tk_coords <- function( tkp.id, @@ -798,7 +796,6 @@ tk_set_coords <- function(tkp.id, coords) { } #' @rdname tkplot -#' @inheritParams rlang::args_dots_empty #' @export tk_rotate <- function( tkp.id, diff --git a/_pkgdown.yml b/_pkgdown.yml index c4502f3b72..22fbbfcc81 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -44,6 +44,9 @@ reference: - subtitle: "Stochastic constructors (random graph models)" - contents: - has_concept("games") +- subtitle: Constructor specifications +- contents: + - has_concept("constructor specifications") - subtitle: Constructor modifiers - contents: - has_concept("constructor modifiers") @@ -56,6 +59,7 @@ reference: - title: Visualization - contents: - has_concept("graph layouts") + - has_concept("layout specifications") - has_concept("layout modifiers") - has_concept("layout_drl") - has_concept("palettes") diff --git a/man/cluster.distribution.Rd b/man/cluster.distribution.Rd index ff4aea9983..6075fd30f1 100644 --- a/man/cluster.distribution.Rd +++ b/man/cluster.distribution.Rd @@ -15,8 +15,9 @@ frequency) is calculated.} \item{mul.size}{Logical. If TRUE the relative frequencies will be multiplied by the cluster sizes.} -\item{...}{Additional attributes to pass to \code{cluster}, right now only -\code{mode} makes sense.} +\item{...}{For \code{component_distribution()}, forwarded to \code{components()}. +For \code{components()}, \code{is_connected()}, \code{count_components()} and +\code{largest_component()}, these dots must be empty.} } \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/cohesive_blocks.Rd b/man/cohesive_blocks.Rd index e03fc6bf35..80162d81f0 100644 --- a/man/cohesive_blocks.Rd +++ b/man/cohesive_blocks.Rd @@ -60,7 +60,9 @@ supplied whose cohesive block structure is given in the \code{blocks()} argument.} \item{\dots}{Additional arguments. \code{plot_hierarchy()} and \code{\link[=plot]{plot()}} pass -them to \code{plot.igraph()}. \code{\link[=print]{print()}} and \code{\link[=summary]{summary()}} ignore them.} +them to \code{plot.igraph()}. \code{\link[=print]{print()}} and \code{\link[=summary]{summary()}} ignore them. +\code{cohesive_blocks()} and \code{export_pajek()} do not accept extra arguments; +these dots must be empty for them.} \item{labels}{Logical, whether to add the vertex labels to the result object. These labels can be then used when reporting and plotting the diff --git a/man/components.Rd b/man/components.Rd index 82a5a4fe0e..7e90fda56b 100644 --- a/man/components.Rd +++ b/man/components.Rd @@ -27,8 +27,9 @@ frequency) is calculated.} \item{mul.size}{Logical. If TRUE the relative frequencies will be multiplied by the cluster sizes.} -\item{\dots}{Additional attributes to pass to \code{cluster}, right now only -\code{mode} makes sense.} +\item{\dots}{For \code{component_distribution()}, forwarded to \code{components()}. +For \code{components()}, \code{is_connected()}, \code{count_components()} and +\code{largest_component()}, these dots must be empty.} \item{mode}{Character string, either \dQuote{weak} or \dQuote{strong}. For directed graphs \dQuote{weak} implies weakly, \dQuote{strong} strongly diff --git a/man/constructor_spec.Rd b/man/constructor_spec.Rd new file mode 100644 index 0000000000..90efd2c4b2 --- /dev/null +++ b/man/constructor_spec.Rd @@ -0,0 +1,59 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R, R/games.R, R/make.R +\name{from_data_frame} +\alias{from_data_frame} +\alias{from_edgelist} +\alias{degseq} +\alias{tree} +\title{Constructor specifications for \code{graph_()}, \code{make_()} and \code{sample_()}} +\usage{ +from_data_frame(...) + +from_edgelist(...) + +degseq(..., deterministic = FALSE) + +tree(...) +} +\arguments{ +\item{...}{Forwarded to the corresponding constructor function.} + +\item{deterministic}{For \code{degseq()}, whether the construction should be +deterministic; if \code{TRUE}, wraps \code{\link[=realize_degseq]{realize_degseq()}} instead of +\code{\link[=sample_degseq]{sample_degseq()}}.} +} +\value{ +An object of class \code{igraph_constructor_spec}. +} +\description{ +Each of these functions builds a lazy constructor specification for the +given graph constructor, to be used with \code{\link[=graph_]{graph_()}}, \code{\link[=make_]{make_()}} or +\code{\link[=sample_]{sample_()}}. The specification is only evaluated when the graph is actually +constructed, so it can be combined with constructor modifiers such as +\code{\link[=with_vertex_]{with_vertex_()}} or \code{\link[=with_edge_]{with_edge_()}}. + +\code{from_data_frame()}, \code{from_edgelist()}, \code{tree()} and \code{degseq()} wrap +\code{\link[=graph_from_data_frame]{graph_from_data_frame()}}, \code{\link[=graph_from_edgelist]{graph_from_edgelist()}}, \code{\link[=make_tree]{make_tree()}} (or +\code{\link[=sample_tree]{sample_tree()}}) and \code{\link[=sample_degseq]{sample_degseq()}} (or \code{\link[=realize_degseq]{realize_degseq()}}), +respectively. + +The other constructors have specification functions as well; they are +documented together with the constructor they wrap, e.g. \code{ring()} on the +\code{\link[=make_ring]{make_ring()}} page. +} +\examples{ +# Pass a constructor specification to graph_(), make_() or sample_() +el <- cbind(1:5, c(2:5, 1)) +graph_(el, from_edgelist(directed = FALSE)) + +make_(tree(7)) + +# Specifications can be combined with constructor modifiers +make_(tree(7), with_vertex_(color = "red")) +} +\seealso{ +\code{\link[=graph_]{graph_()}}, \code{\link[=make_]{make_()}} and \code{\link[=sample_]{sample_()}} to apply a constructor +specification. +} +\concept{constructor specifications} +\keyword{graphs} diff --git a/man/graph_from_data_frame.Rd b/man/graph_from_data_frame.Rd index f435b5f650..3be6d13a4c 100644 --- a/man/graph_from_data_frame.Rd +++ b/man/graph_from_data_frame.Rd @@ -3,14 +3,11 @@ \name{as_data_frame} \alias{as_data_frame} \alias{graph_from_data_frame} -\alias{from_data_frame} \title{Creating igraph graphs from data frames or vice-versa} \usage{ as_data_frame(x, what = c("edges", "vertices", "both")) graph_from_data_frame(d, directed = TRUE, ..., vertices = NULL) - -from_data_frame(...) } \arguments{ \item{x}{An igraph object.} @@ -25,7 +22,7 @@ version 0.7 this argument is coerced to a data frame with \item{directed}{Logical, whether or not to create a directed graph.} -\item{...}{Passed to \code{graph_from_data_frame()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{vertices}{A data frame with vertex metadata, or \code{NULL}. See details below. Since version 0.7 this argument is coerced to a data frame @@ -130,7 +127,8 @@ as_data_frame(g, what = "edges") \seealso{ \code{\link[=graph_from_literal]{graph_from_literal()}} for another way to create graphs, \code{\link[=read.table]{read.table()}} to read in tables -from files. +from files. See \code{\link[=from_data_frame]{from_data_frame()}} to build a lazy constructor +specification for \code{\link[=make_]{make_()}} or \code{\link[=sample_]{sample_()}}. Other conversion: \code{\link[=as.matrix.igraph]{as.matrix.igraph()}}, diff --git a/man/graph_from_edgelist.Rd b/man/graph_from_edgelist.Rd index 7d24a70576..ca80ca830d 100644 --- a/man/graph_from_edgelist.Rd +++ b/man/graph_from_edgelist.Rd @@ -2,17 +2,14 @@ % Please edit documentation in R/conversion.R \name{graph_from_edgelist} \alias{graph_from_edgelist} -\alias{from_edgelist} \title{Create a graph from an edge list matrix} \usage{ graph_from_edgelist(el, ..., directed = TRUE) - -from_edgelist(...) } \arguments{ \item{el}{The edge list, a two column matrix, character or numeric.} -\item{...}{Passed to \code{graph_from_edgelist()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{directed}{Whether to create a directed graph.} } @@ -39,6 +36,9 @@ graph_from_edgelist(el) graph_from_edgelist(cbind(1:10, c(2:10, 1))) } \seealso{ +\code{\link[=from_edgelist]{from_edgelist()}} to build a lazy constructor specification for +\code{\link[=make_]{make_()}} or \code{\link[=sample_]{sample_()}}. + Other deterministic constructors: \code{\link[=graph_from_atlas]{graph_from_atlas()}}, \code{\link[=graph_from_literal]{graph_from_literal()}}, diff --git a/man/igraph_opt.Rd b/man/igraph_opt.Rd new file mode 100644 index 0000000000..c2dbecd336 --- /dev/null +++ b/man/igraph_opt.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/par.R +\name{igraph_opt} +\alias{igraph_opt} +\title{Query a single igraph parameter} +\usage{ +igraph_opt(x, ..., default = NULL) +} +\arguments{ +\item{x}{A character string holding an option name.} + +\item{...}{These dots are for future extensions and must be empty.} + +\item{default}{If the specified option is not set in the options list, this +value is returned. This facilitates retrieving an option and checking +whether it is set and setting it separately if not.} +} +\value{ +The current value set for option \code{x}, or \code{NULL} if the option is +unset. +} +\description{ +Retrieve the current value of one igraph option set via +\code{\link[=igraph_options]{igraph_options()}}. +} +\examples{ +oldval <- igraph_opt("verbose") +igraph_options(verbose = TRUE) +layout_with_kk(make_ring(10)) +igraph_options(verbose = oldval) +} +\seealso{ +Similar to \code{\link[=getOption]{getOption()}}. See \code{\link[=igraph_options]{igraph_options()}} to set options. + +Other igraph options: +\code{\link[=igraph_options]{igraph_options()}}, +\code{\link[=with_igraph_opt]{with_igraph_opt()}} +} +\author{ +Gabor Csardi \email{csardi.gabor@gmail.com} +} +\concept{igraph options} +\keyword{graphs} diff --git a/man/igraph_options.Rd b/man/igraph_options.Rd index 8ba971f89f..7cf8b8f798 100644 --- a/man/igraph_options.Rd +++ b/man/igraph_options.Rd @@ -2,31 +2,18 @@ % Please edit documentation in R/par.R \name{igraph_options} \alias{igraph_options} -\alias{igraph_opt} \title{Parameters for the igraph package} \usage{ igraph_options(...) - -igraph_opt(x, ..., default = NULL) } \arguments{ \item{\dots}{A list may be given as the only argument, or any number of arguments may be in the \code{name=value} form, or no argument at all may be given. See the Value and Details sections for explanation.} - -\item{x}{A character string holding an option name.} - -\item{default}{If the specified option is not set in the options list, this -value is returned. This facilitates retrieving an option and checking -whether it is set and setting it separately if not.} } \value{ -\code{igraph_options()} returns a list with the old values of the -updated parameters, invisibly. Without any arguments, it returns the -values of all options. - -For \code{igraph_opt()}, the current value set for option \code{x}, or -\code{NULL} if the option is unset. +A list with the old values of the updated parameters, invisibly. +Without any arguments, it returns the values of all options. } \description{ igraph has some parameters which (usually) affect the behavior of many @@ -135,10 +122,11 @@ igraph_opt("verbose") } \seealso{ -\code{igraph_options()} is similar to \code{\link[=options]{options()}} and -\code{igraph_opt()} is similar to \code{\link[=getOption]{getOption()}}. +Similar to \code{\link[=options]{options()}}. See \code{\link[=igraph_opt]{igraph_opt()}} to retrieve the +value of a single option. Other igraph options: +\code{\link[=igraph_opt]{igraph_opt()}}, \code{\link[=with_igraph_opt]{with_igraph_opt()}} } \author{ diff --git a/man/layout.auto.Rd b/man/layout.auto.Rd index ff8c13953d..0278f8f3d9 100644 --- a/man/layout.auto.Rd +++ b/man/layout.auto.Rd @@ -11,9 +11,8 @@ layout.auto(graph, dim = 2, ...) \item{dim}{Dimensions, should be 2 or 3.} -\item{...}{For \code{layout_nicely()} the extra arguments are passed to -the real layout function. For \code{nicely()} all argument are passed to -\code{layout_nicely()}.} +\item{...}{Extra arguments are passed to the real layout function that +\code{layout_nicely()} ends up calling.} } \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_as_bipartite.Rd b/man/layout_as_bipartite.Rd index c02f8d368c..83158b0359 100644 --- a/man/layout_as_bipartite.Rd +++ b/man/layout_as_bipartite.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_as_bipartite} \alias{layout_as_bipartite} -\alias{as_bipartite} \title{Simple two-row layout for bipartite graphs} \usage{ layout_as_bipartite( @@ -13,8 +12,6 @@ layout_as_bipartite( vgap = 1, maxiter = 100 ) - -as_bipartite(...) } \arguments{ \item{graph}{The bipartite input graph. It should have a logical @@ -25,7 +22,7 @@ given.} \code{NULL} (the default), then the \sQuote{\code{type}} vertex attribute is used.} -\item{...}{Arguments to pass to \code{layout_as_bipartite()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{hgap}{Real scalar, the minimum horizontal gap between vertices in the same layer.} @@ -69,7 +66,8 @@ g \%>\% plot() } \seealso{ -\code{\link[=layout_with_sugiyama]{layout_with_sugiyama()}} +\code{\link[=layout_with_sugiyama]{layout_with_sugiyama()}}. See \code{\link[=as_bipartite]{as_bipartite()}} to build a lazy +layout specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_as_star.Rd b/man/layout_as_star.Rd index 5e488de3a9..7c0dcb06d5 100644 --- a/man/layout_as_star.Rd +++ b/man/layout_as_star.Rd @@ -2,17 +2,14 @@ % Please edit documentation in R/layout.R \name{layout_as_star} \alias{layout_as_star} -\alias{as_star} \title{Generate coordinates to place the vertices of a graph in a star-shape} \usage{ layout_as_star(graph, ..., center = NULL, order = NULL) - -as_star(...) } \arguments{ \item{graph}{The graph to layout.} -\item{...}{Arguments to pass to \code{layout_as_star()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{center}{The ID of the vertex to put in the center. The default \code{NULL} uses the first vertex.} @@ -47,7 +44,8 @@ layout_(g, as_star()) \seealso{ \code{\link[=layout]{layout()}} and \code{\link[=layout_with_drl]{layout_with_drl()}} for other layout algorithms, \code{\link[=plot.igraph]{plot.igraph()}} and \code{\link[=tkplot]{tkplot()}} on how to -plot graphs and \code{\link[=star]{star()}} on how to create ring graphs. +plot graphs and \code{\link[=star]{star()}} on how to create ring graphs. See \code{\link[=as_star]{as_star()}} to +build a lazy layout specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_as_tree.Rd b/man/layout_as_tree.Rd index 8da0425eb2..e5251f93f2 100644 --- a/man/layout_as_tree.Rd +++ b/man/layout_as_tree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_as_tree} \alias{layout_as_tree} -\alias{as_tree} \title{The Reingold-Tilford graph layout algorithm} \usage{ layout_as_tree( @@ -14,13 +13,11 @@ layout_as_tree( mode = c("out", "in", "all"), flip.y = TRUE ) - -as_tree(...) } \arguments{ \item{graph}{The input graph.} -\item{...}{Passed to \code{layout_as_tree()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{root}{The index of the root vertex or root vertices. If this is a non-empty vector then the supplied vertex IDs are used as the roots of the @@ -87,6 +84,9 @@ Reingold, E and Tilford, J (1981). Tidier drawing of trees. \emph{IEEE Trans. on Softw. Eng.}, SE-7(2):223--228. } \seealso{ +\code{\link[=as_tree]{as_tree()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_in_circle.Rd b/man/layout_in_circle.Rd index 4fda9824f9..0a6326ce01 100644 --- a/man/layout_in_circle.Rd +++ b/man/layout_in_circle.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/layout.R \name{layout_in_circle} \alias{layout_in_circle} -\alias{in_circle} \title{Graph layout with vertices on a circle.} \usage{ layout_in_circle(graph, order = NULL) - -in_circle(...) } \arguments{ \item{graph}{The input graph.} @@ -16,8 +13,6 @@ in_circle(...) desired placement. Vertices that are not included here will be placed at (0,0). The default \code{NULL} selects all vertices, in the order of their IDs.} - -\item{...}{Passed to \code{layout_in_circle()}.} } \value{ A numeric matrix with two columns, and one row for each vertex. @@ -52,6 +47,9 @@ plot(karate, layout = coords) \dontshow{\}) # examplesIf} } \seealso{ +\code{\link[=in_circle]{in_circle()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_nicely.Rd b/man/layout_nicely.Rd index 4235ff7230..47a723f87e 100644 --- a/man/layout_nicely.Rd +++ b/man/layout_nicely.Rd @@ -2,21 +2,17 @@ % Please edit documentation in R/layout.R \name{layout_nicely} \alias{layout_nicely} -\alias{nicely} \title{Choose an appropriate graph layout algorithm automatically} \usage{ layout_nicely(graph, dim = 2, ...) - -nicely(...) } \arguments{ \item{graph}{The input graph} \item{dim}{Dimensions, should be 2 or 3.} -\item{\dots}{For \code{layout_nicely()} the extra arguments are passed to -the real layout function. For \code{nicely()} all argument are passed to -\code{layout_nicely()}.} +\item{\dots}{Extra arguments are passed to the real layout function that +\code{layout_nicely()} ends up calling.} } \value{ A numeric matrix with two or three columns. @@ -63,7 +59,8 @@ can use \code{weights = NA} to silence the warning. } \seealso{ -\code{\link[=plot.igraph]{plot.igraph()}} +\code{\link[=plot.igraph]{plot.igraph()}}. See \code{\link[=nicely]{nicely()}} to build a lazy layout +specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_on_grid.Rd b/man/layout_on_grid.Rd index b36f1273d8..cb1d7705ae 100644 --- a/man/layout_on_grid.Rd +++ b/man/layout_on_grid.Rd @@ -2,17 +2,14 @@ % Please edit documentation in R/layout.R \name{layout_on_grid} \alias{layout_on_grid} -\alias{on_grid} \title{Simple grid layout} \usage{ layout_on_grid(graph, ..., width = 0, height = 0, dim = 2) - -on_grid(...) } \arguments{ \item{graph}{The input graph.} -\item{...}{Passed to \code{layout_on_grid()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{width}{The number of vertices in a single row of the grid. If this is zero or negative, then for 2d layouts the width of the grid will be the @@ -55,7 +52,8 @@ if (interactive() && requireNamespace("rgl", quietly = TRUE)) { } } \seealso{ -\code{\link[=layout]{layout()}} for other layout generators +\code{\link[=layout]{layout()}} for other layout generators. See \code{\link[=on_grid]{on_grid()}} to build +a lazy layout specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_on_sphere.Rd b/man/layout_on_sphere.Rd index a1ccb68fbc..bcb61d7d3f 100644 --- a/man/layout_on_sphere.Rd +++ b/man/layout_on_sphere.Rd @@ -2,17 +2,12 @@ % Please edit documentation in R/layout.R \name{layout_on_sphere} \alias{layout_on_sphere} -\alias{on_sphere} \title{Graph layout with vertices on the surface of a sphere} \usage{ layout_on_sphere(graph) - -on_sphere(...) } \arguments{ \item{graph}{The input graph.} - -\item{...}{Passed to \code{layout_on_sphere()}.} } \value{ A numeric matrix with three columns, and one row for each vertex. @@ -34,6 +29,9 @@ If you want to order the vertices differently, then permute them using the } \seealso{ +\code{\link[=on_sphere]{on_sphere()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_randomly.Rd b/man/layout_randomly.Rd index 8bfb119d6d..d7f4593f95 100644 --- a/man/layout_randomly.Rd +++ b/man/layout_randomly.Rd @@ -2,17 +2,14 @@ % Please edit documentation in R/layout.R \name{layout_randomly} \alias{layout_randomly} -\alias{randomly} \title{Randomly place vertices on a plane or in 3d space} \usage{ layout_randomly(graph, ..., dim = c(2, 3)) - -randomly(...) } \arguments{ \item{graph}{The input graph.} -\item{...}{Parameters to pass to \code{layout_randomly()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{dim}{Integer scalar, the dimension of the space to use. It must be 2 or 3.} @@ -34,6 +31,9 @@ layout generators. } \seealso{ +\code{\link[=randomly]{randomly()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_spec.Rd b/man/layout_spec.Rd new file mode 100644 index 0000000000..0b31839626 --- /dev/null +++ b/man/layout_spec.Rd @@ -0,0 +1,102 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{as_bipartite} +\alias{as_bipartite} +\alias{as_star} +\alias{as_tree} +\alias{in_circle} +\alias{nicely} +\alias{on_grid} +\alias{on_sphere} +\alias{randomly} +\alias{with_dh} +\alias{with_fr} +\alias{with_gem} +\alias{with_graphopt} +\alias{with_kk} +\alias{with_lgl} +\alias{with_mds} +\alias{with_sugiyama} +\alias{with_drl} +\title{Layout specifications for \code{layout_()} and \code{add_layout_()}} +\usage{ +as_bipartite(...) + +as_star(...) + +as_tree(...) + +in_circle(...) + +nicely(...) + +on_grid(...) + +on_sphere(...) + +randomly(...) + +with_dh(...) + +with_fr(...) + +with_gem(...) + +with_graphopt(...) + +with_kk(...) + +with_lgl(...) + +with_mds(...) + +with_sugiyama(...) + +with_drl(...) +} +\arguments{ +\item{...}{Forwarded to the corresponding \verb{layout_*()} function.} +} +\value{ +An object of class \code{igraph_layout_spec}. +} +\description{ +Each of these functions builds a lazy layout specification for the given +layout function, to be used with \code{\link[=layout_]{layout_()}} or \code{\link[=add_layout_]{add_layout_()}}. The +specification is only evaluated when the layout is actually computed, so it +can be combined with layout modifiers such as \code{\link[=component_wise]{component_wise()}} or +\code{\link[=normalize]{normalize()}}. + +\code{as_bipartite()}, \code{as_star()} and \code{as_tree()} wrap \code{\link[=layout_as_bipartite]{layout_as_bipartite()}}, +\code{\link[=layout_as_star]{layout_as_star()}} and \code{\link[=layout_as_tree]{layout_as_tree()}} respectively. \code{in_circle()}, +\code{nicely()}, \code{on_grid()}, \code{on_sphere()} and \code{randomly()} wrap +\code{\link[=layout_in_circle]{layout_in_circle()}}, \code{\link[=layout_nicely]{layout_nicely()}}, \code{\link[=layout_on_grid]{layout_on_grid()}}, +\code{\link[=layout_on_sphere]{layout_on_sphere()}} and \code{\link[=layout_randomly]{layout_randomly()}}. \code{with_dh()}, \code{with_fr()}, +\code{with_gem()}, \code{with_graphopt()}, \code{with_kk()}, \code{with_lgl()}, \code{with_mds()}, +\code{with_sugiyama()} and \code{with_drl()} wrap \code{\link[=layout_with_dh]{layout_with_dh()}}, +\code{\link[=layout_with_fr]{layout_with_fr()}}, \code{\link[=layout_with_gem]{layout_with_gem()}}, \code{\link[=layout_with_graphopt]{layout_with_graphopt()}}, +\code{\link[=layout_with_kk]{layout_with_kk()}}, \code{\link[=layout_with_lgl]{layout_with_lgl()}}, \code{\link[=layout_with_mds]{layout_with_mds()}}, +\code{\link[=layout_with_sugiyama]{layout_with_sugiyama()}} and \code{\link[=layout_with_drl]{layout_with_drl()}}. +} +\examples{ +g <- make_ring(10) + +# Pass a layout specification to layout_() ... +layout_(g, in_circle()) + +# ... or store the layout in the graph with add_layout_() +g <- add_layout_(g, with_fr()) +g$layout + +# Specifications take the arguments of the layout function they wrap +layout_(make_star(10), as_star(center = 5)) + +# and can be combined with layout modifiers +layout_(make_ring(10) + make_ring(5), with_fr(), component_wise()) +} +\seealso{ +\code{\link[=layout_]{layout_()}} and \code{\link[=add_layout_]{add_layout_()}} to apply a layout specification +to a graph. +} +\concept{layout specifications} +\keyword{graphs} diff --git a/man/layout_with_dh.Rd b/man/layout_with_dh.Rd index 107e502166..3b7f56da3c 100644 --- a/man/layout_with_dh.Rd +++ b/man/layout_with_dh.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_dh} \alias{layout_with_dh} -\alias{with_dh} \title{The Davidson-Harel layout algorithm} \usage{ layout_with_dh( @@ -18,13 +17,11 @@ layout_with_dh( weight.edge.crossings = NULL, weight.node.edge.dist = NULL ) - -with_dh(...) } \arguments{ \item{graph}{The graph to lay out. Edge directions are ignored.} -\item{...}{Passed to \code{layout_with_dh()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{coords}{Optional starting positions for the vertices. If this argument is not \code{NULL} then it should be an appropriate matrix of starting @@ -153,7 +150,8 @@ Annealing. \emph{ACM Transactions on Graphics} 15(4), pp. 301-331, 1996. } \seealso{ \code{\link[=layout_with_fr]{layout_with_fr()}}, -\code{\link[=layout_with_kk]{layout_with_kk()}} for other layout algorithms. +\code{\link[=layout_with_kk]{layout_with_kk()}} for other layout algorithms. See \code{\link[=with_dh]{with_dh()}} to build a +lazy layout specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_with_drl.Rd b/man/layout_with_drl.Rd index e7441d81fa..4bac53d7f2 100644 --- a/man/layout_with_drl.Rd +++ b/man/layout_with_drl.Rd @@ -8,7 +8,6 @@ \alias{igraph.drl.default} \alias{igraph.drl.final} \alias{igraph.drl.refine} -\alias{with_drl} \title{The DrL graph layout generator} \usage{ layout_with_drl( @@ -20,13 +19,11 @@ layout_with_drl( weights = NULL, dim = c(2, 3) ) - -with_drl(...) } \arguments{ \item{graph}{The input graph, in can be directed or undirected.} -\item{...}{Passed to \code{layout_with_drl()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{use.seed}{Logical, whether to use the coordinates given in the \code{seed} argument as a starting point.} @@ -163,7 +160,8 @@ Klavans, R., Boyack, K.W., DrL: Distributed Recursive (Graph) Layout. SAND Reports, 2008. 2936: p. 1-10. } \seealso{ -\code{\link[=layout]{layout()}} for other layout generators. +\code{\link[=layout]{layout()}} for other layout generators. See \code{\link[=with_drl]{with_drl()}} to +build a lazy layout specification for \code{\link[=add_layout_]{add_layout_()}}. } \author{ Shawn Martin (\url{https://www.cs.otago.ac.nz/homepages/smartin/}) diff --git a/man/layout_with_fr.Rd b/man/layout_with_fr.Rd index 90f32995dc..9484491cf3 100644 --- a/man/layout_with_fr.Rd +++ b/man/layout_with_fr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_fr} \alias{layout_with_fr} -\alias{with_fr} \title{The Fruchterman-Reingold layout algorithm} \usage{ layout_with_fr( @@ -26,13 +25,11 @@ layout_with_fr( repulserad = deprecated(), maxiter = deprecated() ) - -with_fr(...) } \arguments{ \item{graph}{The graph to lay out. Edge directions are ignored.} -\item{...}{Passed to \code{layout_with_fr()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{coords}{Optional starting positions for the vertices. If this argument is not \code{NULL} then it should be an appropriate matrix of starting @@ -131,7 +128,8 @@ Force-directed Placement. \emph{Software - Practice and Experience}, } \seealso{ \code{\link[=layout_with_drl]{layout_with_drl()}}, \code{\link[=layout_with_kk]{layout_with_kk()}} for -other layout algorithms. +other layout algorithms. See \code{\link[=with_fr]{with_fr()}} to build a lazy layout +specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_with_gem.Rd b/man/layout_with_gem.Rd index d0d906cc43..9fb74e2a0f 100644 --- a/man/layout_with_gem.Rd +++ b/man/layout_with_gem.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_gem} \alias{layout_with_gem} -\alias{with_gem} \title{The GEM layout algorithm} \usage{ layout_with_gem( @@ -14,13 +13,11 @@ layout_with_gem( temp.min = 0.1, temp.init = NULL ) - -with_gem(...) } \arguments{ \item{graph}{The input graph. Edge directions are ignored.} -\item{...}{Passed to \code{layout_with_gem()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{coords}{Starting coordinates in a two or three column matrix, depending on the \code{dim} argument. @@ -69,7 +66,8 @@ LNCS 894, pp. 388-403, 1995. } \seealso{ \code{\link[=layout_with_fr]{layout_with_fr()}}, -\code{\link[=plot.igraph]{plot.igraph()}}, \code{\link[=tkplot]{tkplot()}} +\code{\link[=plot.igraph]{plot.igraph()}}, \code{\link[=tkplot]{tkplot()}}. See \code{\link[=with_gem]{with_gem()}} to build a lazy layout +specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_with_graphopt.Rd b/man/layout_with_graphopt.Rd index 5cdd3fb363..0d56e5ff1f 100644 --- a/man/layout_with_graphopt.Rd +++ b/man/layout_with_graphopt.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_graphopt} \alias{layout_with_graphopt} -\alias{with_graphopt} \title{The graphopt layout algorithm} \usage{ layout_with_graphopt( @@ -16,13 +15,11 @@ layout_with_graphopt( spring.constant = 1, max.sa.movement = 5 ) - -with_graphopt(...) } \arguments{ \item{graph}{The input graph.} -\item{...}{Passed to \code{layout_with_graphopt()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{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 @@ -68,6 +65,9 @@ reaches an equilibrium. (There is no simulated annealing or anything like that, so a stable fixed point is not guaranteed.) } \seealso{ +\code{\link[=with_graphopt]{with_graphopt()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_with_kk.Rd b/man/layout_with_kk.Rd index 7d9d6dfda7..55ad91753e 100644 --- a/man/layout_with_kk.Rd +++ b/man/layout_with_kk.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_kk} \alias{layout_with_kk} -\alias{with_kk} \title{The Kamada-Kawai layout algorithm} \usage{ layout_with_kk( @@ -26,13 +25,11 @@ layout_with_kk( coolexp = deprecated(), start = deprecated() ) - -with_kk(...) } \arguments{ \item{graph}{The input graph. Edge directions are ignored.} -\item{...}{Passed to \code{layout_with_kk()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{coords}{Starting coordinates in a two or three column matrix, depending on the \code{dim} argument. @@ -114,7 +111,8 @@ Undirected Graphs. \emph{Information Processing Letters}, 31/1, 7--15, 1989. } \seealso{ \code{\link[=layout_with_drl]{layout_with_drl()}}, \code{\link[=plot.igraph]{plot.igraph()}}, -\code{\link[=tkplot]{tkplot()}} +\code{\link[=tkplot]{tkplot()}}. See \code{\link[=with_kk]{with_kk()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_with_lgl.Rd b/man/layout_with_lgl.Rd index ee5fa9bfd3..3a41057a0e 100644 --- a/man/layout_with_lgl.Rd +++ b/man/layout_with_lgl.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_lgl} \alias{layout_with_lgl} -\alias{with_lgl} \title{Large Graph Layout} \usage{ layout_with_lgl( @@ -16,13 +15,11 @@ layout_with_lgl( cellsize = NULL, root = NULL ) - -with_lgl(...) } \arguments{ \item{graph}{The input graph} -\item{...}{Passed to \code{layout_with_lgl()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{maxiter}{The maximum number of iterations to perform (150).} @@ -61,6 +58,9 @@ generator of the Large Graph Layout software } \seealso{ +\code{\link[=with_lgl]{with_lgl()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/layout_with_mds.Rd b/man/layout_with_mds.Rd index 480d0c035f..cc5d3dff1e 100644 --- a/man/layout_with_mds.Rd +++ b/man/layout_with_mds.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/layout.R \name{layout_with_mds} \alias{layout_with_mds} -\alias{with_mds} \title{Graph layout by multidimensional scaling} \usage{ layout_with_mds(graph, dist = NULL, dim = 2, options = arpack_defaults()) - -with_mds(...) } \arguments{ \item{graph}{The input graph.} @@ -22,8 +19,6 @@ only possible value is 2. This is because \code{merge_coords()} only works in \item{options}{This is currently ignored, as ARPACK is not used any more for solving the eigenproblem} - -\item{...}{Passed to \code{layout_with_mds()}.} } \value{ A numeric matrix with \code{dim} columns. @@ -63,7 +58,8 @@ Cox, T. F. and Cox, M. A. A. (2001) \emph{Multidimensional Scaling}. Second edition. Chapman and Hall. } \seealso{ -\code{\link[=layout]{layout()}}, \code{\link[=plot.igraph]{plot.igraph()}} +\code{\link[=layout]{layout()}}, \code{\link[=plot.igraph]{plot.igraph()}}. See \code{\link[=with_mds]{with_mds()}} to build a lazy +layout specification for \code{\link[=add_layout_]{add_layout_()}}. Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, diff --git a/man/layout_with_sugiyama.Rd b/man/layout_with_sugiyama.Rd index 1ee793d60d..11e4ecf083 100644 --- a/man/layout_with_sugiyama.Rd +++ b/man/layout_with_sugiyama.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_sugiyama} \alias{layout_with_sugiyama} -\alias{with_sugiyama} \title{The Sugiyama graph layout generator} \usage{ layout_with_sugiyama( @@ -15,13 +14,11 @@ layout_with_sugiyama( weights = NULL, attributes = c("default", "all", "none") ) - -with_sugiyama(...) } \arguments{ \item{graph}{The input graph.} -\item{...}{Passed to \code{layout_with_sugiyama()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{layers}{A numeric vector of the layer indices of the vertices. Layers are numbered from one. @@ -243,6 +240,9 @@ Understanding of Hierarchical Systems". IEEE Transactions on Systems, Man and Cybernetics 11(2):109-125, 1981. } \seealso{ +\code{\link[=with_sugiyama]{with_sugiyama()}} to build a lazy layout specification for +\code{\link[=add_layout_]{add_layout_()}}. + Other graph layouts: \code{\link[=add_layout_]{add_layout_()}}, \code{\link[=component_wise]{component_wise()}}, diff --git a/man/make_tree.Rd b/man/make_tree.Rd index 180c70e9e5..c474759118 100644 --- a/man/make_tree.Rd +++ b/man/make_tree.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/make.R \name{make_tree} \alias{make_tree} -\alias{tree} \title{Create tree graphs} \usage{ make_tree(n, children = 2, ..., mode = c("out", "in", "undirected")) - -tree(...) } \arguments{ \item{n}{Number of vertices.} @@ -15,7 +12,7 @@ tree(...) \item{children}{Integer scalar, the number of children of a vertex (except for leafs)} -\item{...}{Passed to \code{make_tree()} or \code{sample_tree()}.} +\item{...}{These dots are for future extensions and must be empty.} \item{mode}{Defines the direction of the edges. \code{out} indicates that the edges point from the parent to @@ -39,6 +36,9 @@ make_tree(10, 2) make_tree(10, 3, mode = "undirected") } \seealso{ +\code{\link[=tree]{tree()}} to build a lazy constructor specification for +\code{\link[=make_]{make_()}} or \code{\link[=sample_]{sample_()}}. + Other deterministic constructors: \code{\link[=graph_from_atlas]{graph_from_atlas()}}, \code{\link[=graph_from_edgelist]{graph_from_edgelist()}}, diff --git a/man/merge_coords.Rd b/man/merge_coords.Rd index 593289a8cc..bdcde15285 100644 --- a/man/merge_coords.Rd +++ b/man/merge_coords.Rd @@ -14,8 +14,9 @@ layout_components(graph, layout = NULL, ...) \item{layouts}{A list of two-column matrices.} -\item{\dots}{Additional arguments to pass to the \code{layout} layout -function.} +\item{\dots}{For \code{layout_components()}, additional arguments to pass to +the \code{layout} layout function. For \code{merge_coords()}, these dots must be +empty.} \item{method}{Character constant giving the method to use. Right now only \code{dla} is implemented.} diff --git a/man/modularity.igraph.Rd b/man/modularity.igraph.Rd index 9f2dec87fb..5684ea9f65 100644 --- a/man/modularity.igraph.Rd +++ b/man/modularity.igraph.Rd @@ -31,7 +31,9 @@ vector of the community structure.} \item{directed}{Whether to use the directed or undirected version of modularity. Ignored for undirected graphs.} -\item{\dots}{Additional arguments, none currently.} +\item{\dots}{For \code{modularity_matrix()}, these dots must be empty. For +\code{modularity()}, unused, present for S3 method consistency but may be +used by other methods that implement it.} } \value{ For \code{modularity()} a numeric scalar, the modularity score of the diff --git a/man/piecewise.layout.Rd b/man/piecewise.layout.Rd index 71052f144a..3442d206bb 100644 --- a/man/piecewise.layout.Rd +++ b/man/piecewise.layout.Rd @@ -12,8 +12,9 @@ piecewise.layout(graph, layout = layout_with_kk, ...) \item{layout}{A function object, the layout function to use. The default \code{NULL} uses \code{layout_with_kk}.} -\item{...}{Additional arguments to pass to the \code{layout} layout -function.} +\item{...}{For \code{layout_components()}, additional arguments to pass to +the \code{layout} layout function. For \code{merge_coords()}, these dots must be +empty.} } \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/plotHierarchy.Rd b/man/plotHierarchy.Rd index 81fb79b068..e3318d8ad2 100644 --- a/man/plotHierarchy.Rd +++ b/man/plotHierarchy.Rd @@ -16,7 +16,9 @@ plotHierarchy( the Reingold-Tilford layout generator.} \item{...}{Additional arguments. \code{plot_hierarchy()} and \code{\link[=plot]{plot()}} pass -them to \code{plot.igraph()}. \code{\link[=print]{print()}} and \code{\link[=summary]{summary()}} ignore them.} +them to \code{plot.igraph()}. \code{\link[=print]{print()}} and \code{\link[=summary]{summary()}} ignore them. +\code{cohesive_blocks()} and \code{export_pajek()} do not accept extra arguments; +these dots must be empty for them.} } \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/sample_degseq.Rd b/man/sample_degseq.Rd index 990585ade6..6f58a0e040 100644 --- a/man/sample_degseq.Rd +++ b/man/sample_degseq.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_degseq} \alias{sample_degseq} -\alias{degseq} \title{Generate random graphs with a given degree sequence} \usage{ sample_degseq( @@ -12,8 +11,6 @@ sample_degseq( method = c("configuration", "vl", "fast.heur.simple", "configuration.simple", "edge.switching.simple") ) - -degseq(..., deterministic = FALSE) } \arguments{ \item{out.deg}{Numeric vector, the sequence of degrees (for undirected @@ -24,12 +21,9 @@ should be even. For directed graphs its sum should be the same as the sum of \item{in.deg}{For directed graph, the in-degree sequence. By default this is \code{NULL} and an undirected graph is created.} -\item{...}{Passed to \code{realize_degseq()} if \sQuote{deterministic} is true, -or to \code{sample_degseq()} otherwise.} +\item{...}{These dots are for future extensions and must be empty.} \item{method}{Character, the method for generating the graph. See Details.} - -\item{deterministic}{Whether the construction should be deterministic} } \value{ The new graph object. @@ -197,7 +191,8 @@ all(degree(powerlaw_vl_graph) == powerlaw_degrees) } \seealso{ \code{\link[=simplify]{simplify()}} to get rid of the multiple and/or loops edges, -\code{\link[=realize_degseq]{realize_degseq()}} for a deterministic variant. +\code{\link[=realize_degseq]{realize_degseq()}} for a deterministic variant. See \code{\link[=degseq]{degseq()}} to build a +lazy constructor specification for \code{\link[=make_]{make_()}} or \code{\link[=sample_]{sample_()}}. Random graph models (games): \code{\link[=bipartite_gnm]{bipartite_gnm()}}, diff --git a/man/sir.Rd b/man/sir.Rd index 50cb9cc3f5..f01107a3f7 100644 --- a/man/sir.Rd +++ b/man/sir.Rd @@ -21,7 +21,9 @@ sir(graph, beta, gamma, ..., no.sim = 100) \arguments{ \item{x}{A \code{sir} object, returned by the \code{sir()} function.} -\item{\dots}{Additional arguments, ignored currently.} +\item{\dots}{For \code{sir()} and \code{time_bins()}, these dots must be empty. For +\code{median.sir()} and \code{quantile.sir()}, unused, present for S3 method +consistency.} \item{middle}{Logical, whether to return the middle of the time bins, or the boundaries.} diff --git a/man/tkplot.Rd b/man/tkplot.Rd index f601f105f7..a7f79ec88a 100644 --- a/man/tkplot.Rd +++ b/man/tkplot.Rd @@ -41,8 +41,9 @@ tk_canvas(tkp.id) \item{canvas.width, canvas.height}{The size of the tkplot drawing area.} -\item{\dots}{Additional plotting parameters. See \link{igraph.plotting} for -the complete list.} +\item{\dots}{For \code{tkplot()}, additional plotting parameters, see +\link{igraph.plotting} for the complete list. For \code{tk_close()}, \code{tk_fit()}, +\code{tk_coords()} and \code{tk_rotate()}, these dots must be empty.} \item{tkp.id}{The ID of the tkplot window to close/reshape/etc.} diff --git a/man/tkplot.reshape.Rd b/man/tkplot.reshape.Rd index 862268ffc4..564dd470eb 100644 --- a/man/tkplot.reshape.Rd +++ b/man/tkplot.reshape.Rd @@ -11,8 +11,9 @@ tkplot.reshape(tkp.id, newlayout, ..., params) \item{newlayout}{The new layout, see the \code{layout} parameter of tkplot.} -\item{...}{Additional plotting parameters. See \link{igraph.plotting} for -the complete list.} +\item{...}{For \code{tkplot()}, additional plotting parameters, see +\link{igraph.plotting} for the complete list. For \code{tk_close()}, \code{tk_fit()}, +\code{tk_coords()} and \code{tk_rotate()}, these dots must be empty.} \item{params}{Extra parameters in a list, to pass to the layout function.} } diff --git a/man/vertex_connectivity.Rd b/man/vertex_connectivity.Rd index e6afe4da66..08451ddbf7 100644 --- a/man/vertex_connectivity.Rd +++ b/man/vertex_connectivity.Rd @@ -22,8 +22,9 @@ can be \code{NULL}, see details below.} \item{target}{The ID of the target vertex, for \code{vertex_connectivity()} it can be \code{NULL}, see details below.} -\item{...}{Additional arguments passed to methods. Not used by \code{vertex_connectivity()} -directly but may be used by other methods that implement \code{cohesion()}.} +\item{\dots}{For \code{vertex_connectivity()}, these dots must be empty. For +\code{cohesion()}, unused, present for S3 method consistency but may be used +by other methods that implement it.} \item{checks}{Logical. Whether to check that the graph is connected and also the degree of the vertices. If the graph is not (strongly) diff --git a/man/with_igraph_opt.Rd b/man/with_igraph_opt.Rd index 95b3c07515..3625ca611a 100644 --- a/man/with_igraph_opt.Rd +++ b/man/with_igraph_opt.Rd @@ -26,6 +26,7 @@ igraph_opt("sparsematrices") } \seealso{ Other igraph options: +\code{\link[=igraph_opt]{igraph_opt()}}, \code{\link[=igraph_options]{igraph_options()}} } \concept{igraph options}