Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/cohesive.blocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -632,7 +633,6 @@ exportPajek.cohesiveblocks.nopf <- function(blocks, graph, file) {
}

#' @rdname cohesive_blocks
#' @inheritParams rlang::args_dots_empty
#' @export
export_pajek <- function(
blocks,
Expand Down
5 changes: 3 additions & 2 deletions R/community.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#'
Expand Down Expand Up @@ -983,7 +985,6 @@ modularity.communities <- function(x, ...) {
}

#' @rdname modularity.igraph
#' @inheritParams rlang::args_dots_empty
#' @export
modularity_matrix <- function(
graph,
Expand Down
1 change: 0 additions & 1 deletion R/components.R
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ is_biconnected <- function(graph) {


#' @rdname components
#' @inheritParams rlang::args_dots_empty
#' @export
largest_component <- function(
graph,
Expand Down
30 changes: 25 additions & 5 deletions R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand Down Expand Up @@ -2077,8 +2078,26 @@ graph_from_data_frame <- function(
g
}

#' @rdname graph_from_data_frame
#' @param ... Passed to `graph_from_data_frame()`.
#' Constructor specifications for `make_()` and `sample_()`
#'
#' @description
#' Each of these functions builds a lazy constructor specification for the
#' given graph constructor, to be used with [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.
#'
#' @param ... Forwarded to the corresponding constructor function.
#' @return An object of class `igraph_constructor_spec`.
#' @seealso [make_()] and [sample_()] to apply a constructor specification.
#' @family deterministic constructors
#' @keywords graphs
#' @rdname constructor_spec
#' @export
from_data_frame <- function(...) constructor_spec(graph_from_data_frame, ...)

Expand All @@ -2098,6 +2117,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
Expand Down Expand Up @@ -2172,7 +2193,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, ...)
1 change: 0 additions & 1 deletion R/epi.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
###################################################################

#' @rdname sir
#' @inheritParams rlang::args_dots_empty
#' @export
time_bins <- function(
x,
Expand Down
6 changes: 3 additions & 3 deletions R/flow.R
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,16 @@ 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
#' degree is one then the vertex connectivity is also one. It is a good idea to
#' 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
Expand Down
11 changes: 6 additions & 5 deletions R/games.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
Loading
Loading