From 07d6759f4d1ec383ec9a35d41b0cb6429a7cb0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 12:04:22 +0100 Subject: [PATCH 01/48] refactor: manually edit zzz-deprecate.R --- R/zzz-deprecate.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/zzz-deprecate.R b/R/zzz-deprecate.R index c950fc3300c..2855616994d 100644 --- a/R/zzz-deprecate.R +++ b/R/zzz-deprecate.R @@ -156,7 +156,7 @@ deprecated("edge.betweenness.community", cluster_edge_betweenness) #' @export edge.connectivity deprecated("edge.connectivity", edge_connectivity) #' @export edge.disjoint.paths -deprecated("edge.disjoint.paths", edge_disjoint_paths) +deprecated("edge.disjoint.paths", edge_connectivity) #' @export establishment.game deprecated("establishment.game", sample_traits) #' @export evcent @@ -533,7 +533,7 @@ deprecated("watts.strogatz.game", sample_smallworld) #' @export write.graph deprecated("write.graph", write_graph) #' @export graph.famous -deprecated("graph.famous", make_famous_graph) +deprecated("graph.famous", make_graph) #' @export igraph.from.graphNEL deprecated("igraph.from.graphNEL", graph_from_graphnel) #' @export igraph.to.graphNEL From a6e7b36397b494095fa2afd7e9c4f83b5bb9bf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 12:23:24 +0100 Subject: [PATCH 02/48] refactor: add tools script&template refactor: start improving script improve script better script better script improve script --- tools/deprecate-template.txt | 14 ++ tools/deprecate.R | 348 +++++++++++++++++++++++++++++++++++ 2 files changed, 362 insertions(+) create mode 100644 tools/deprecate-template.txt create mode 100644 tools/deprecate.R diff --git a/tools/deprecate-template.txt b/tools/deprecate-template.txt new file mode 100644 index 00000000000..d89192d9dec --- /dev/null +++ b/tools/deprecate-template.txt @@ -0,0 +1,14 @@ +#' {{new_title}} +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `{{old}}()` was renamed to `{{new}}()` to create a more +#' consistent API. +{{inheritParamsOrNot}} +#' @keywords internal +#' @export +{{old}} <- function({{{new_usage}}}) { # nocov start + lifecycle::deprecate_soft("1.6.0", "{{old}}()", "{{new}}()") + {{new}}({{args}}) +} # nocov end diff --git a/tools/deprecate.R b/tools/deprecate.R new file mode 100644 index 00000000000..a9a93eeeeb5 --- /dev/null +++ b/tools/deprecate.R @@ -0,0 +1,348 @@ +# parse script ---- +zzz_script <- here::here("R", "zzz-deprecate.R") + +parse_script <- function(path) { + path |> + parse(keep.source = TRUE) |> + xmlparsedata::xml_parse_data(pretty = TRUE) |> + xml2::read_xml() +} + +xml <- parse_script(zzz_script) + +# extract all calls to deprecated() +deprecated_calls <- xml2::xml_find_all( + xml, + ".//SYMBOL_FUNCTION_CALL[text()='deprecated']" +) + +tibblify_call <- function(deprecated_call) { + args <- deprecated_call |> + xml2::xml_parent() |> + xml2::xml_siblings() |> + purrr::keep(~xml2::xml_name(.x) == "expr") + old <- xml2::xml_text(args[[1]]) + new <- xml2::xml_text(args[[2]]) + tibble::tibble(old = gsub('"', '', old), new = new) +} + +deprecated_df <- purrr::map_df(deprecated_calls, tibblify_call) + +# utils ---- + +.parse_impl_assignements <- function() { + scripts <- fs::dir_ls(here::here("R")) |> + purrr::keep(~(.x != zzz_script)) |> + purrr::map(parse_script) + + parse_script_function_call <- function(xml) { + kiddos <- xml2::xml_children(xml) + candidates <- kiddos[xml2::xml_name(kiddos) == "expr"] + candidates <- candidates[purrr::map_int(candidates, ~length(xml2::xml_children(.x))) == 3] + + purrr::map_df( + candidates, + ~ tibble::tibble( + left = xml2::xml_children(.x)[[1]] |> xml2::xml_text(), + right = xml2::xml_children(.x)[[3]] |> xml2::xml_text() + ) + ) + } + + purrr::map_df(scripts, parse_script_function_call) +} +parse_impl_assignements <- memoise::memoise(.parse_impl_assignements) + +parse_package_defs <- function() { + scripts <- fs::dir_ls(here::here("R")) |> + purrr::keep(~(.x != zzz_script)) |> + purrr::map(parse_script) + + parse_script_function_call <- function(script, script_name) { + fns <- xml2::xml_find_all(script, ".//FUNCTION[text()='function']") + is_fn_definition <- function(fn) { + siblings <- fn |> xml2::xml_parent() |> xml2::xml_siblings() + (length(siblings) == 2) && (xml2::xml_name(siblings[[2]]) == "LEFT_ASSIGN") + } + fns <- purrr::keep(fns, is_fn_definition) + + parse_function <- function(fn) { + whole_definition <- fn |> xml2::xml_parent()|> xml2::xml_parent() + line1 <- xml2::xml_attr(whole_definition, "line1") + line2 <- xml2::xml_attr(whole_definition, "line2") + name <- whole_definition |> xml2::xml_child() |> xml2::xml_text() + + if (name %in% c( + "tk_off", + "get_all_options", + "tkigraph", + ".tkigraph.clusters", + "show.communities", + "sortPopup" + )) { + return( + tibble::tibble( + line1 = line1, + line2 = line2, + name = name, + usage = "", + args = "" + ) + ) + } + + args <- xml2::xml_find_all(whole_definition, "./*/SYMBOL_FORMALS") |> xml2::xml_text() + if (length(args) > 0) { + if ("..." %in% args) { + if (length(args) == 1) { + args <- "..." + } else { + args <- toString(c(glue::glue("{args[args!='...']} = {args[args!='...']}"), "...")) + } + } else { + args <- toString(glue::glue("{args} = {args}")) + } + + usage_wrap <- xml2::xml_children(whole_definition)[[3]] |> xml2::xml_children() + # TODO use XPath not numbers? although this should work? + usage <- usage_wrap[3:(length(usage_wrap)-2)] |> xml2::xml_text() |> paste(collapse = " ") + } else { + args <- "" + usage <- "" + } + + tibble::tibble( + line1 = line1, + line2 = line2, + name = name, + usage = usage, + args = args + ) + } + script_df <- purrr::map_df(fns, parse_function) + script_df$script_name <- script_name + script_df + } + + purrr::map2_df(scripts, names(scripts), parse_script_function_call) +} + +# split zzz-deprecate.R ---- +pkg_defs <- parse_package_defs() +zzz_lines <- brio::read_lines(zzz_script) +export_lines <- which(startsWith(zzz_lines, "#' @export ")) +move_one <- function(index, zzz_lines, pkg_defs) { + lines <- zzz_lines[index:(index+1)] + new <- trimws(sub(".*,", "", sub("\\)$", "", lines[2]))) + + script <- system2( + "grep", + c("-r", sprintf("'^%s <- '", new), "R"), + stdout = TRUE + ) + script <- script[!endsWith(script, new)] + script <- sub("\\:.*", "", script) + + script_lines <- c( + brio::read_lines(script), + lines + ) + brio::write_lines(script_lines, script) +} + +purrr::walk(export_lines, move_one, zzz_lines = zzz_lines, pkg_defs = pkg_defs) +brio::write_lines(zzz_lines[1:29], zzz_script) +fs::file_move(zzz_script, "R/aaa-a-deprecate.R") +zzz_script <- "R/aaa-a-deprecate.R" +# remove ALL the aliases ---- +# to the deprecated functions as they will +# get an actual page +clean_alias <- function(aliases, x) { + output <- gsub(sprintf(" %s ", x), " ", aliases) + output <- gsub(sprintf(" %s$", x), "", output) + + output[!grepl("@aliases", output)] <- sub( + "#' ", "#' @aliases ", + output[!grepl("@aliases", output)] + ) + + output +} + + +remove_aliases <- function(script, to_be_deprecated) { + lines <- brio::read_lines(script) + + which_aliases <- grepl("@aliases", lines) | + (grepl("@aliases", dplyr::lag(lines, 1)) & + grepl("^#' (?!\\@)", lines, perl = TRUE)) + aliases_present <- (sum(which_aliases) > 0) + + if (aliases_present) { + + aliases <- lines[which_aliases] + aliases <- purrr::reduce( + to_be_deprecated, + \(aliases, x) clean_alias(aliases, x ), + .init = aliases + ) + lines[which_aliases] <- aliases + lines <- purrr::discard( + lines, + \(x) trimws(x) == "#' @aliases" + ) + } + + brio::write_lines(lines, script) +} + +purrr::walk( + fs::dir_ls(here::here("R")) , + remove_aliases, + to_be_deprecated = deprecated_df$old, + .progress = TRUE +) + +# parse ALL the package scripts ---- + + +# get docs from pkgdown ---- +get_title <- function(fn_name) { + + if (fn_name == "adjacent_triangles") { + fn_name <- "count_triangles" + } + + rd_href <- pkgdown:::get_rd_from_help("igraph", fn_name) + pkgdown:::extract_title(rd_href) +} +topics <- pkgdown::as_pkgdown()[["topics"]] + +# treat calls ---- +treat_call <- function(old, new, topics) { + if (old %in% c("igraph.eigen.default", "igraph.arpack.default")) { + return() + } + + pkg_defs <- parse_package_defs() + template <- paste(readLines(here::here("tools", "deprecate-template.txt")), collapse = "\n") + + relevant_row <- pkg_defs[pkg_defs[["name"]] == new,] + + if (nrow(relevant_row) == 0) { + relevant_row <- pkg_defs[pkg_defs[["name"]] == sprintf("%s_impl", new),] + } + + if (nrow(relevant_row) == 0) { + assignments <- parse_impl_assignements() + actual_def <- assignments[["right"]][assignments[["left"]] == new] + relevant_row <- pkg_defs[pkg_defs[["name"]] == actual_def,] + } + + if (nrow(relevant_row) > 1) { + relevant_row <- relevant_row[!grepl("aaa-auto", relevant_row[["script_name"]]),] + } + + if (grepl("_impl$", new)) { + new <- sub("_impl$", "", new) + } + + if (!nzchar(relevant_row[["args"]])) { + inheritParamsOrNot <- "#'" + } else { + inheritParamsOrNot <- sprintf("#' @inheritParams %s", new) + } + + new_text <- whisker::whisker.render( + template, + data = list( + old = old, + new = new, + args = relevant_row[["args"]], + inheritParamsOrNot = inheritParamsOrNot, + new_usage = relevant_row[["usage"]], + new_title = stringr::str_squish(get_title(new)) + ) + ) + + script <- system2( + "grep", + c("-r", sprintf("'^%s <- '", new), "R"), + stdout = TRUE + ) + script <- script[!endsWith(script, new)] + script <- sub("\\:.*", "", script) + script_lines <- brio::read_lines(script) + new_lines <- append( + c("", strsplit(new_text, "\n")[[1]]), + values = script_lines + ) + brio::write_lines(new_lines, script) +} +purrr::walk2( + deprecated_df[["old"]], + deprecated_df[["new"]], + treat_call, + topics = topics, + .progress = TRUE +) + +# delete deprecated() calls ---- +remove_deprecated_calls <- function(script) { + lines <- brio::read_lines(script) + deprecated <- which(startsWith(lines, "deprecated(")) + if (length(deprecated) == 0) { + return() + } + + lines <- lines[1:(min(deprecated) - 1)] + brio::write_lines(lines, script) +} +purrr::walk(fs::dir_ls(here::here("R")), remove_deprecated_calls) + +fs::file_delete(zzz_script) + +# add docs by hand for graph.cohesion() params +devtools::document() +devtools::check() +# git checkout man +# git checkout NAMESPACE +# git clean -f + +gert::git_add("tools/deprecate.R") +gert::git_commit("add tools script and template") +gert::git_add("R/zzz-deprecate.R") +gert::git_commit("rm zzz-deprecate") +gert::git_push() +# modif by hand +# https://github.com/igraph/rigraph/pull/970/commits/a336806f1cd64573a4705f1bc8b966ac1e53b07d +# https://github.com/igraph/rigraph/pull/970/commits/6a14368f9ab6405bab30342fa81fb358afc9a9ff +# https://github.com/igraph/rigraph/pull/970/commits/d40a77150cd52dbd8125694d736b193d6be6da35 +gert::git_branch_create("throwaway") + +files <- gert::git_status()[["file"]] +files <- files[startsWith(files, "R/")] +snapshot_file <- function(path) { + gert::git_add(path) + gert::git_commit(sprintf("refactor!: change %s", path)) +} +commits <- purrr::map_chr(files, snapshot_file) + +# some manual rebasing to delete the deprecated() def last... +commits <- c(commits[-1], commits[1]) +gert::git_branch_checkout("zzz-smarter") + +build_commit <- function(commit) { + message(commit) + message <- trimws(gert::git_commit_info(commit)[["message"]]) + + gert::git_cherry_pick(commit) + gert::git_reset_soft(gert::git_log(max=2)$commit[2]) + + devtools::document() + + gert::git_add("R/*") + gert::git_add("man/*") + gert::git_commit(message) +} +purrr::walk(commits, build_commit) From 18a9120eeacba98d7e999bc24db02d6661881331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 13:21:47 +0100 Subject: [PATCH 03/48] refactor: split zzz-deprecate --- R/aaa-a-deprecate.R | 29 ++ R/adjacency.R | 2 + R/assortativity.R | 4 + R/attributes.R | 30 ++ R/basic.R | 2 + R/bipartite.R | 6 + R/centrality.R | 22 ++ R/centralization.R | 18 ++ R/cliques.R | 16 ++ R/cohesive.blocks.R | 12 + R/community.R | 34 +++ R/components.R | 10 + R/console.R | 2 + R/conversion.R | 18 ++ R/data_frame.R | 4 + R/decomposition.R | 2 + R/degseq.R | 4 + R/demo.R | 2 + R/fit.R | 2 + R/flow.R | 28 ++ R/foreign.R | 6 + R/games.R | 48 ++++ R/glet.R | 4 + R/hrg.R | 12 + R/incidence.R | 2 + R/interface.R | 10 + R/layout.R | 24 ++ R/layout_drl.R | 2 + R/make.R | 36 +++ R/minimum.spanning.tree.R | 2 + R/motifs.R | 10 + R/operators.R | 12 + R/other.R | 6 + R/par.R | 4 + R/paths.R | 6 + R/plot.common.R | 2 + R/plot.shapes.R | 8 + R/scg.R | 2 + R/simple.R | 2 + R/structural.properties.R | 56 ++++ R/structure.info.R | 2 + R/test.R | 4 + R/tkplot.R | 20 ++ R/topology.R | 10 + R/triangles.R | 2 + R/zzz-deprecate.R | 564 -------------------------------------- 46 files changed, 539 insertions(+), 564 deletions(-) create mode 100644 R/aaa-a-deprecate.R delete mode 100644 R/zzz-deprecate.R diff --git a/R/aaa-a-deprecate.R b/R/aaa-a-deprecate.R new file mode 100644 index 00000000000..d5bcc3846a9 --- /dev/null +++ b/R/aaa-a-deprecate.R @@ -0,0 +1,29 @@ + +# IGraph R package +# Copyright (C) 2014 Gabor Csardi +# 334 Harvard street, Cambridge, MA 02139 USA +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA +# +################################################################### + +## For the future, right now, we do not warn or even message + +#' @importFrom utils packageName +deprecated <- function(old, new) { + assign(old, new, envir = asNamespace(packageName())) +} + diff --git a/R/adjacency.R b/R/adjacency.R index 13053bb9a81..f94c0846f09 100644 --- a/R/adjacency.R +++ b/R/adjacency.R @@ -455,3 +455,5 @@ is_symmetric <- function(x) { #' @family adjacency #' @export from_adjacency <- function(...) constructor_spec(graph_from_adjacency_matrix, ...) +#' @export graph.adjacency +deprecated("graph.adjacency", graph_from_adjacency_matrix) diff --git a/R/assortativity.R b/R/assortativity.R index 262e45f95a4..416299b3080 100644 --- a/R/assortativity.R +++ b/R/assortativity.R @@ -170,3 +170,7 @@ assortativity_nominal <- assortativity_nominal_impl #' @rdname assortativity #' @export assortativity_degree <- assortativity_degree_impl +#' @export assortativity.degree +deprecated("assortativity.degree", assortativity_degree) +#' @export assortativity.nominal +deprecated("assortativity.nominal", assortativity_nominal) diff --git a/R/attributes.R b/R/attributes.R index d05897718ea..9b203acaccf 100644 --- a/R/attributes.R +++ b/R/attributes.R @@ -969,3 +969,33 @@ NULL `$<-.igraph` <- function(x, name, value) { set_graph_attr(x, name, value) } +#' @export get.edge.attribute +deprecated("get.edge.attribute", edge_attr) +#' @export get.graph.attribute +deprecated("get.graph.attribute", graph_attr) +#' @export get.vertex.attribute +deprecated("get.vertex.attribute", vertex_attr) +#' @export is.bipartite +deprecated("is.bipartite", is_bipartite) +#' @export is.named +deprecated("is.named", is_named) +#' @export is.weighted +deprecated("is.weighted", is_weighted) +#' @export list.edge.attributes +deprecated("list.edge.attributes", edge_attr_names) +#' @export list.graph.attributes +deprecated("list.graph.attributes", graph_attr_names) +#' @export list.vertex.attributes +deprecated("list.vertex.attributes", vertex_attr_names) +#' @export remove.edge.attribute +deprecated("remove.edge.attribute", delete_edge_attr) +#' @export remove.graph.attribute +deprecated("remove.graph.attribute", delete_graph_attr) +#' @export remove.vertex.attribute +deprecated("remove.vertex.attribute", delete_vertex_attr) +#' @export set.edge.attribute +deprecated("set.edge.attribute", set_edge_attr) +#' @export set.graph.attribute +deprecated("set.graph.attribute", set_graph_attr) +#' @export set.vertex.attribute +deprecated("set.vertex.attribute", set_vertex_attr) diff --git a/R/basic.R b/R/basic.R index de2ee6da9b0..290bf062b0a 100644 --- a/R/basic.R +++ b/R/basic.R @@ -99,3 +99,5 @@ head_of <- function(graph, es) { tail_of <- function(graph, es) { create_vs(graph, ends(graph, es, names = FALSE)[, 1]) } +#' @export is.igraph +deprecated("is.igraph", is_igraph) diff --git a/R/bipartite.R b/R/bipartite.R index 46250da34c4..9cc2bbbff7a 100644 --- a/R/bipartite.R +++ b/R/bipartite.R @@ -195,3 +195,9 @@ bipartite_projection_size <- bipartite_projection_size_impl #' @family bipartite #' @export bipartite_mapping <- is_bipartite_impl +#' @export bipartite.mapping +deprecated("bipartite.mapping", bipartite_mapping) +#' @export bipartite.projection +deprecated("bipartite.projection", bipartite_projection) +#' @export bipartite.projection.size +deprecated("bipartite.projection.size", bipartite_projection_size) diff --git a/R/centrality.R b/R/centrality.R index 1f2da59977b..6399281643c 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -1487,3 +1487,25 @@ alpha_centrality <- function(graph, nodes = V(graph), alpha = 1, } res } +#' @export alpha.centrality +deprecated("alpha.centrality", alpha_centrality) +#' @export authority.score +deprecated("authority.score", authority_score) +#' @export bonpow +deprecated("bonpow", power_centrality) +#' @export edge.betweenness +deprecated("edge.betweenness", edge_betweenness) +#' @export evcent +deprecated("evcent", eigen_centrality) +#' @export graph.diversity +deprecated("graph.diversity", diversity) +#' @export graph.eigen +deprecated("graph.eigen", spectrum) +#' @export graph.strength +deprecated("graph.strength", strength) +#' @export hub.score +deprecated("hub.score", hub_score) +#' @export page.rank +deprecated("page.rank", page_rank) +#' @export subgraph.centrality +deprecated("subgraph.centrality", subgraph_centrality) diff --git a/R/centralization.R b/R/centralization.R index 8ca23ecd854..b6aea8525cc 100644 --- a/R/centralization.R +++ b/R/centralization.R @@ -370,3 +370,21 @@ centr_eigen <- centralization_eigenvector_centrality_impl #' `/`(centr_eigen_tmax(g)) #' centr_eigen(g, normalized = TRUE)$centralization centr_eigen_tmax <- centralization_eigenvector_centrality_tmax_impl +#' @export centralization.betweenness +deprecated("centralization.betweenness", centr_betw) +#' @export centralization.betweenness.tmax +deprecated("centralization.betweenness.tmax", centr_betw_tmax) +#' @export centralization.closeness +deprecated("centralization.closeness", centr_clo) +#' @export centralization.closeness.tmax +deprecated("centralization.closeness.tmax", centr_clo_tmax) +#' @export centralization.degree +deprecated("centralization.degree", centr_degree) +#' @export centralization.degree.tmax +deprecated("centralization.degree.tmax", centr_degree_tmax) +#' @export centralization.evcent +deprecated("centralization.evcent", centr_eigen) +#' @export centralization.evcent.tmax +deprecated("centralization.evcent.tmax", centr_eigen_tmax) +#' @export centralize.scores +deprecated("centralize.scores", centralize) diff --git a/R/cliques.R b/R/cliques.R index 12832db2b52..35f0b41cdf0 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -381,3 +381,19 @@ clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) { clique_size_hist_impl(graph, min, max) } } +#' @export clique.number +deprecated("clique.number", clique_num) +#' @export independence.number +deprecated("independence.number", ivs_size) +#' @export independent.vertex.sets +deprecated("independent.vertex.sets", ivs) +#' @export largest.cliques +deprecated("largest.cliques", largest_cliques) +#' @export largest.independent.vertex.sets +deprecated("largest.independent.vertex.sets", largest_ivs) +#' @export maximal.cliques +deprecated("maximal.cliques", max_cliques) +#' @export maximal.cliques.count +deprecated("maximal.cliques.count", count_max_cliques) +#' @export maximal.independent.vertex.sets +deprecated("maximal.independent.vertex.sets", maximal_ivs) diff --git a/R/cohesive.blocks.R b/R/cohesive.blocks.R index c4296b0b94e..5d100e72bed 100644 --- a/R/cohesive.blocks.R +++ b/R/cohesive.blocks.R @@ -599,3 +599,15 @@ max_cohesion <- function(blocks) { ## | [21] ... ## '- B-5 c. 3, n. 4 [ 1] ......o.oo o......... ## [21] ... +#' @export blockGraphs +deprecated("blockGraphs", graphs_from_cohesive_blocks) +#' @export cohesive.blocks +deprecated("cohesive.blocks", cohesive_blocks) +#' @export graph.cohesion +deprecated("graph.cohesion", cohesion) +#' @export maxcohesion +deprecated("maxcohesion", max_cohesion) +#' @export plotHierarchy +deprecated("plotHierarchy", plot_hierarchy) +#' @export exportPajek +deprecated("exportPajek", export_pajek) diff --git a/R/community.R b/R/community.R index 82059f69f95..6945e00a51a 100644 --- a/R/community.R +++ b/R/community.R @@ -2531,3 +2531,37 @@ communities <- groups.communities #' @export #' @family functions for manipulating graph structure contract <- contract_vertices_impl +#' @export code.length +deprecated("code.length", code_len) +#' @export contract.vertices +deprecated("contract.vertices", contract) +#' @export cutat +deprecated("cutat", cut_at) +#' @export dendPlot +deprecated("dendPlot", plot_dendrogram) +#' @export edge.betweenness.community +deprecated("edge.betweenness.community", cluster_edge_betweenness) +#' @export fastgreedy.community +deprecated("fastgreedy.community", cluster_fast_greedy) +#' @export infomap.community +deprecated("infomap.community", cluster_infomap) +#' @export is.hierarchical +deprecated("is.hierarchical", is_hierarchical) +#' @export label.propagation.community +deprecated("label.propagation.community", cluster_label_prop) +#' @export leading.eigenvector.community +deprecated("leading.eigenvector.community", cluster_leading_eigen) +#' @export mod.matrix +deprecated("mod.matrix", modularity_matrix) +#' @export multilevel.community +deprecated("multilevel.community", cluster_louvain) +#' @export optimal.community +deprecated("optimal.community", cluster_optimal) +#' @export showtrace +deprecated("showtrace", show_trace) +#' @export spinglass.community +deprecated("spinglass.community", cluster_spinglass) +#' @export walktrap.community +deprecated("walktrap.community", cluster_walktrap) +#' @export create.communities +deprecated("create.communities", make_clusters) diff --git a/R/components.R b/R/components.R index 9565cd1525f..bd73ded2033 100644 --- a/R/components.R +++ b/R/components.R @@ -216,3 +216,13 @@ largest_component <- function(graph, mode = c("weak", "strong")) { induced_subgraph(graph, vids) } +#' @export articulation.points +deprecated("articulation.points", articulation_points) +#' @export biconnected.components +deprecated("biconnected.components", biconnected_components) +#' @export cluster.distribution +deprecated("cluster.distribution", component_distribution) +#' @export decompose.graph +deprecated("decompose.graph", decompose) +#' @export no.clusters +deprecated("no.clusters", count_components) diff --git a/R/console.R b/R/console.R index db017a8e88d..f5beb7b8b26 100644 --- a/R/console.R +++ b/R/console.R @@ -281,3 +281,5 @@ close.igraphconsole <- function(con, ...) { pb <- list(widget = pBar, get = get, set = set, label = .lab) list(frame = frame, pb = pb) } +#' @export igraph.console +deprecated("igraph.console", console) diff --git a/R/conversion.R b/R/conversion.R index ca0b1c3bc94..e553dedd5bb 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -1068,3 +1068,21 @@ as.matrix.igraph <- function(x, matrix.type = c("adjacency", "edgelist"), ...) { edgelist = as_edgelist(graph = x, ...) ) } +#' @export get.adjedgelist +deprecated("get.adjedgelist", as_adj_edge_list) +#' @export get.adjlist +deprecated("get.adjlist", as_adj_list) +#' @export get.adjacency +deprecated("get.adjacency", as_adjacency_matrix) +#' @export get.data.frame +deprecated("get.data.frame", as_data_frame) +#' @export get.edgelist +deprecated("get.edgelist", as_edgelist) +#' @export get.incidence +deprecated("get.incidence", as_biadjacency_matrix) +#' @export graph.adjlist +deprecated("graph.adjlist", graph_from_adj_list) +#' @export igraph.from.graphNEL +deprecated("igraph.from.graphNEL", graph_from_graphnel) +#' @export igraph.to.graphNEL +deprecated("igraph.to.graphNEL", as_graphnel) diff --git a/R/data_frame.R b/R/data_frame.R index f941683efd9..231214d8277 100644 --- a/R/data_frame.R +++ b/R/data_frame.R @@ -261,3 +261,7 @@ graph_from_edgelist <- function(el, directed = TRUE) { #' @param ... Passed to `graph_from_edgelist()`. #' @export from_edgelist <- function(...) constructor_spec(graph_from_edgelist, ...) +#' @export graph.data.frame +deprecated("graph.data.frame", graph_from_data_frame) +#' @export graph.edgelist +deprecated("graph.edgelist", graph_from_edgelist) diff --git a/R/decomposition.R b/R/decomposition.R index 4f93bbc857b..ac93e60e9e5 100644 --- a/R/decomposition.R +++ b/R/decomposition.R @@ -106,3 +106,5 @@ is_chordal <- function(graph, alpha = NULL, alpham1 = NULL, } res } +#' @export is.chordal +deprecated("is.chordal", is_chordal) diff --git a/R/degseq.R b/R/degseq.R index 625a14404b2..223c7733200 100644 --- a/R/degseq.R +++ b/R/degseq.R @@ -98,3 +98,7 @@ is_degseq <- function(out.deg, in.deg = NULL) { #' is_graphical(degree(g)) #' @export is_graphical <- is_graphical_impl +#' @export is.degree.sequence +deprecated("is.degree.sequence", is_degseq) +#' @export is.graphical.degree.sequence +deprecated("is.graphical.degree.sequence", is_graphical) diff --git a/R/demo.R b/R/demo.R index 523a1bd0563..b278efff502 100644 --- a/R/demo.R +++ b/R/demo.R @@ -192,3 +192,5 @@ igraph_demo <- function(which) { invisible() } +#' @export igraphdemo +deprecated("igraphdemo", igraph_demo) diff --git a/R/fit.R b/R/fit.R index 4a9db033b73..c286a9dbefb 100644 --- a/R/fit.R +++ b/R/fit.R @@ -184,3 +184,5 @@ power.law.fit.new <- function(data, xmin = -1, force.continuous = FALSE) { res } +#' @export power.law.fit +deprecated("power.law.fit", fit_power_law) diff --git a/R/flow.R b/R/flow.R index 8b0d77a82ed..ae7a1197b6e 100644 --- a/R/flow.R +++ b/R/flow.R @@ -796,3 +796,31 @@ is_min_separator <- is_minimal_separator_impl #' ) #' min_separators(camp) min_separators <- minimum_size_separators_impl +#' @export dominator.tree +deprecated("dominator.tree", dominator_tree) +#' @export edge.connectivity +deprecated("edge.connectivity", edge_connectivity) +#' @export edge.disjoint.paths +deprecated("edge.disjoint.paths", edge_connectivity) +#' @export graph.adhesion +deprecated("graph.adhesion", adhesion) +#' @export graph.maxflow +deprecated("graph.maxflow", max_flow) +#' @export graph.mincut +deprecated("graph.mincut", min_cut) +#' @export is.minimal.separator +deprecated("is.minimal.separator", is_min_separator) +#' @export is.separator +deprecated("is.separator", is_separator) +#' @export minimal.st.separators +deprecated("minimal.st.separators", min_st_separators) +#' @export minimum.size.separators +deprecated("minimum.size.separators", min_separators) +#' @export stCuts +deprecated("stCuts", st_cuts) +#' @export stMincuts +deprecated("stMincuts", st_min_cuts) +#' @export vertex.connectivity +deprecated("vertex.connectivity", vertex_connectivity) +#' @export vertex.disjoint.paths +deprecated("vertex.disjoint.paths", vertex_disjoint_paths) diff --git a/R/foreign.R b/R/foreign.R index 73466162546..14bd9ac1bfe 100644 --- a/R/foreign.R +++ b/R/foreign.R @@ -600,3 +600,9 @@ write.graph.leda <- function(graph, file, vertex.attr = NULL, edge.attr = NULL, on.exit(.Call(R_igraph_finalizer)) .Call(R_igraph_write_graph_leda, graph, file, vertex.attr, edge.attr) } +#' @export graph.graphdb +deprecated("graph.graphdb", graph_from_graphdb) +#' @export read.graph +deprecated("read.graph", read_graph) +#' @export write.graph +deprecated("write.graph", write_graph) diff --git a/R/games.R b/R/games.R index d9fa0c75ecd..9697aa32da8 100644 --- a/R/games.R +++ b/R/games.R @@ -1847,3 +1847,51 @@ sample_correlated_gnp <- correlated_game_impl #' gg #' cor(as.vector(gg[[1]][]), as.vector(gg[[2]][])) sample_correlated_gnp_pair <- correlated_pair_game_impl +#' @export aging.prefatt.game +deprecated("aging.prefatt.game", sample_pa_age) +#' @export aging.ba.game +deprecated("aging.ba.game", sample_pa_age) +#' @export aging.barabasi.game +deprecated("aging.barabasi.game", sample_pa_age) +#' @export asymmetric.preference.game +deprecated("asymmetric.preference.game", sample_asym_pref) +#' @export ba.game +deprecated("ba.game", sample_pa) +#' @export barabasi.game +deprecated("barabasi.game", sample_pa) +#' @export bipartite.random.game +deprecated("bipartite.random.game", sample_bipartite) +#' @export callaway.traits.game +deprecated("callaway.traits.game", sample_traits_callaway) +#' @export cited.type.game +deprecated("cited.type.game", sample_cit_types) +#' @export citing.cited.type.game +deprecated("citing.cited.type.game", sample_cit_cit_types) +#' @export connect.neighborhood +deprecated("connect.neighborhood", connect) +#' @export degree.sequence.game +deprecated("degree.sequence.game", sample_degseq) +#' @export establishment.game +deprecated("establishment.game", sample_traits) +#' @export forest.fire.game +deprecated("forest.fire.game", sample_forestfire) +#' @export growing.random.game +deprecated("growing.random.game", sample_growing) +#' @export grg.game +deprecated("grg.game", sample_grg) +#' @export interconnected.islands.game +deprecated("interconnected.islands.game", sample_islands) +#' @export k.regular.game +deprecated("k.regular.game", sample_k_regular) +#' @export lastcit.game +deprecated("lastcit.game", sample_last_cit) +#' @export preference.game +deprecated("preference.game", sample_pref) +#' @export sbm.game +deprecated("sbm.game", sample_sbm) +#' @export static.fitness.game +deprecated("static.fitness.game", sample_fitness) +#' @export static.power.law.game +deprecated("static.power.law.game", sample_fitness_pl) +#' @export watts.strogatz.game +deprecated("watts.strogatz.game", sample_smallworld) diff --git a/R/glet.R b/R/glet.R index 23d396463d4..6195080a02f 100644 --- a/R/glet.R +++ b/R/glet.R @@ -177,3 +177,7 @@ function() { #' @rdname graphlet_basis #' @export graphlets <- graphlets_impl +#' @export graphlets.candidate.basis +deprecated("graphlets.candidate.basis", graphlet_basis) +#' @export graphlets.project +deprecated("graphlets.project", graphlet_proj) diff --git a/R/hrg.R b/R/hrg.R index c0626d2671f..3a04f9ea2be 100644 --- a/R/hrg.R +++ b/R/hrg.R @@ -935,3 +935,15 @@ B-7 p=1 B-5 2 " +#' @export hrg.consensus +deprecated("hrg.consensus", consensus_tree) +#' @export hrg.create +deprecated("hrg.create", hrg) +#' @export hrg.dendrogram +deprecated("hrg.dendrogram", hrg_tree) +#' @export hrg.game +deprecated("hrg.game", sample_hrg) +#' @export hrg.fit +deprecated("hrg.fit", fit_hrg) +#' @export hrg.predict +deprecated("hrg.predict", predict_edges) diff --git a/R/incidence.R b/R/incidence.R index fcffb34e49c..a55d3fa9df3 100644 --- a/R/incidence.R +++ b/R/incidence.R @@ -284,3 +284,5 @@ graph_from_incidence_matrix <- function(...) { # nocov start lifecycle::deprecate_soft("1.6.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()") graph_from_biadjacency_matrix(...) } # nocov end +#' @export graph.incidence +deprecated("graph.incidence", graph_from_biadjacency_matrix) diff --git a/R/interface.R b/R/interface.R index 29c011197ca..a8202bf0543 100644 --- a/R/interface.R +++ b/R/interface.R @@ -573,3 +573,13 @@ incident_edges <- function(graph, v, res } +#' @export add.edges +deprecated("add.edges", add_edges) +#' @export add.vertices +deprecated("add.vertices", add_vertices) +#' @export delete.edges +deprecated("delete.edges", delete_edges) +#' @export delete.vertices +deprecated("delete.vertices", delete_vertices) +#' @export is.directed +deprecated("is.directed", is_directed) diff --git a/R/layout.R b/R/layout.R index 15b9973ccca..fa25b32bdc3 100644 --- a/R/layout.R +++ b/R/layout.R @@ -2065,3 +2065,27 @@ layout.fruchterman.reingold.grid <- function(graph, ...) { ) layout_with_fr(graph) } +#' @export layout.auto +deprecated("layout.auto", layout_nicely) +#' @export layout.bipartite +deprecated("layout.bipartite", layout_as_bipartite) +#' @export layout.davidson.harel +deprecated("layout.davidson.harel", layout_with_dh) +#' @export layout.gem +deprecated("layout.gem", layout_with_gem) +#' @export layout.graphopt +deprecated("layout.graphopt", layout_with_graphopt) +#' @export layout.grid +deprecated("layout.grid", layout_on_grid) +#' @export layout.mds +deprecated("layout.mds", layout_with_mds) +#' @export layout.merge +deprecated("layout.merge", merge_coords) +#' @export layout.norm +deprecated("layout.norm", norm_coords) +#' @export layout.star +deprecated("layout.star", layout_as_star) +#' @export layout.sugiyama +deprecated("layout.sugiyama", layout_with_sugiyama) +#' @export piecewise.layout +deprecated("piecewise.layout", layout_components) diff --git a/R/layout_drl.R b/R/layout_drl.R index 84bb912e2e7..7b3355236e4 100644 --- a/R/layout_drl.R +++ b/R/layout_drl.R @@ -288,3 +288,5 @@ drl_defaults <- list( final = igraph.drl.final, refine = igraph.drl.refine ) +#' @export layout.drl +deprecated("layout.drl", layout_with_drl) diff --git a/R/make.R b/R/make.R index 92e07196250..5fb67ada124 100644 --- a/R/make.R +++ b/R/make.R @@ -1791,3 +1791,39 @@ graph_from_lcf <- lcf_vector_impl #' g5 <- realize_degseq(degs, allowed.edge.types = "multi") #' all(degree(g5) == degs) realize_degseq <- realize_degree_sequence_impl +#' @export graph.atlas +deprecated("graph.atlas", graph_from_atlas) +#' @export graph.bipartite +deprecated("graph.bipartite", make_bipartite_graph) +#' @export graph.de.bruijn +deprecated("graph.de.bruijn", make_de_bruijn_graph) +#' @export graph.empty +deprecated("graph.empty", make_empty_graph) +#' @export graph.extended.chordal.ring +deprecated("graph.extended.chordal.ring", make_chordal_ring) +#' @export graph.formula +deprecated("graph.formula", graph_from_literal) +#' @export graph.full +deprecated("graph.full", make_full_graph) +#' @export graph.full.bipartite +deprecated("graph.full.bipartite", make_full_bipartite_graph) +#' @export graph.full.citation +deprecated("graph.full.citation", make_full_citation_graph) +#' @export graph.kautz +deprecated("graph.kautz", make_kautz_graph) +#' @export graph.lattice +deprecated("graph.lattice", make_lattice) +#' @export graph.lcf +deprecated("graph.lcf", graph_from_lcf) +#' @export graph.star +deprecated("graph.star", make_star) +#' @export graph.tree +deprecated("graph.tree", make_tree) +#' @export graph.ring +deprecated("graph.ring", make_ring) +#' @export line.graph +deprecated("line.graph", make_line_graph) +#' @export graph.famous +deprecated("graph.famous", make_graph) +#' @export graph +deprecated("graph", make_graph) diff --git a/R/minimum.spanning.tree.R b/R/minimum.spanning.tree.R index d98e51d57cd..3c0ed5c1088 100644 --- a/R/minimum.spanning.tree.R +++ b/R/minimum.spanning.tree.R @@ -89,3 +89,5 @@ mst <- function(graph, weights = NULL, stop("Invalid algorithm") } } +#' @export minimum.spanning.tree +deprecated("minimum.spanning.tree", mst) diff --git a/R/motifs.R b/R/motifs.R index 65c4eb04de0..528549e5332 100644 --- a/R/motifs.R +++ b/R/motifs.R @@ -240,3 +240,13 @@ dyad_census <- function(graph) { #' @family motifs #' @export triad_census <- triad_census_impl +#' @export dyad.census +deprecated("dyad.census", dyad_census) +#' @export graph.motifs +deprecated("graph.motifs", motifs) +#' @export graph.motifs.est +deprecated("graph.motifs.est", sample_motifs) +#' @export graph.motifs.no +deprecated("graph.motifs.no", count_motifs) +#' @export triad.census +deprecated("triad.census", triad_census) diff --git a/R/operators.R b/R/operators.R index 3ffb7c08144..57d358fda1f 100644 --- a/R/operators.R +++ b/R/operators.R @@ -1194,3 +1194,15 @@ reverse_edges <- reverse_edges_impl #' @family functions for manipulating graph structure #' @export t.igraph <- function(x) reverse_edges(x) +#' @export graph.complementer +deprecated("graph.complementer", complementer) +#' @export graph.compose +deprecated("graph.compose", compose) +#' @export graph.disjoint.union +deprecated("graph.disjoint.union", disjoint_union) +#' @export graph.difference +deprecated("graph.difference", difference) +#' @export graph.union +deprecated("graph.union", union.igraph) +#' @export graph.intersection +deprecated("graph.intersection", intersection) diff --git a/R/other.R b/R/other.R index 139a41b6be2..4c6619f232f 100644 --- a/R/other.R +++ b/R/other.R @@ -179,3 +179,9 @@ igraph.i.spMatrix <- function(M) { #' @family other #' @export convex_hull <- convex_hull_impl +#' @export convex.hull +deprecated("convex.hull", convex_hull) +#' @export igraph.sample +deprecated("igraph.sample", sample_seq) +#' @export running.mean +deprecated("running.mean", running_mean) diff --git a/R/par.R b/R/par.R index e944db5b9b6..5704cc350e1 100644 --- a/R/par.R +++ b/R/par.R @@ -247,3 +247,7 @@ with_igraph_opt <- function(options, code) { old <- igraph_options(options) force(code) } +#' @export getIgraphOpt +deprecated("getIgraphOpt", igraph_opt) +#' @export igraph.options +deprecated("igraph.options", igraph_options) diff --git a/R/paths.R b/R/paths.R index 681709bbb88..7d0b6cc38de 100644 --- a/R/paths.R +++ b/R/paths.R @@ -262,3 +262,9 @@ radius <- radius_impl #' this argument is ignored for undirected graphs. #' @export distance_table <- path_length_hist_impl +#' @export is.dag +deprecated("is.dag", is_dag) +#' @export maximum.cardinality.search +deprecated("maximum.cardinality.search", max_cardinality) +#' @export path.length.hist +deprecated("path.length.hist", distance_table) diff --git a/R/plot.common.R b/R/plot.common.R index 91cbd82cb0c..b5df0280b36 100644 --- a/R/plot.common.R +++ b/R/plot.common.R @@ -972,3 +972,5 @@ i.default.values <- new.env() i.default.values[["vertex"]] <- i.vertex.default i.default.values[["edge"]] <- i.edge.default i.default.values[["plot"]] <- i.plot.default +#' @export autocurve.edges +deprecated("autocurve.edges", curve_multiple) diff --git a/R/plot.shapes.R b/R/plot.shapes.R index 5f1a814b4d7..1ef92b38e73 100644 --- a/R/plot.shapes.R +++ b/R/plot.shapes.R @@ -1101,3 +1101,11 @@ mypie <- function(x, y, values, radius, edges = 200, col = NULL, angle = 45, clip = .igraph.shape.raster.clip, plot = .igraph.shape.raster.plot ) +#' @export add.vertex.shape +deprecated("add.vertex.shape", add_shape) +#' @export vertex.shapes +deprecated("vertex.shapes", shapes) +#' @export igraph.shape.noclip +deprecated("igraph.shape.noclip", shape_noclip) +#' @export igraph.shape.noplot +deprecated("igraph.shape.noplot", shape_noplot) diff --git a/R/scg.R b/R/scg.R index f544bc8e07d..c9573f74529 100644 --- a/R/scg.R +++ b/R/scg.R @@ -131,3 +131,5 @@ stochastic_matrix <- function(graph, column.wise = FALSE, res } +#' @export get.stochastic +deprecated("get.stochastic", stochastic_matrix) diff --git a/R/simple.R b/R/simple.R index 30f34975400..1ab4dd3ad90 100644 --- a/R/simple.R +++ b/R/simple.R @@ -93,3 +93,5 @@ simplify_and_colorize <- function(graph) { E(res$res)$color <- res$edge_color res$res } +#' @export is.simple +deprecated("is.simple", is_simple) diff --git a/R/structural.properties.R b/R/structural.properties.R index 6c94eec9e9e..3a67652a7f6 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -2346,3 +2346,59 @@ which_mutual <- is_mutual_impl #' @family structural.properties #' @export knn <- avg_nearest_neighbor_degree_impl +#' @export average.path.length +deprecated("average.path.length", mean_distance) +#' @export clusters +deprecated("clusters", components) +#' @export count.multiple +deprecated("count.multiple", count_multiple) +#' @export degree.distribution +deprecated("degree.distribution", degree_distribution) +#' @export farthest.nodes +deprecated("farthest.nodes", farthest_vertices) +#' @export graph.bfs +deprecated("graph.bfs", bfs) +#' @export graph.coreness +deprecated("graph.coreness", coreness) +#' @export graph.density +deprecated("graph.density", edge_density) +#' @export graph.dfs +deprecated("graph.dfs", dfs) +#' @export graph.knn +deprecated("graph.knn", knn) +#' @export graph.laplacian +deprecated("graph.laplacian", laplacian_matrix) +#' @export graph.neighborhood +deprecated("graph.neighborhood", make_ego_graph) +#' @export has.multiple +deprecated("has.multiple", any_multiple) +#' @export induced.subgraph +deprecated("induced.subgraph", induced_subgraph) +#' @export is.connected +deprecated("is.connected", is_connected) +#' @export is.loop +deprecated("is.loop", which_loop) +#' @export is.matching +deprecated("is.matching", is_matching) +#' @export is.maximal.matching +deprecated("is.maximal.matching", is_max_matching) +#' @export is.multiple +deprecated("is.multiple", which_multiple) +#' @export is.mutual +deprecated("is.mutual", which_mutual) +#' @export maximum.bipartite.matching +deprecated("maximum.bipartite.matching", max_bipartite_match) +#' @export neighborhood.size +deprecated("neighborhood.size", ego_size) +#' @export shortest.paths +deprecated("shortest.paths", distances) +#' @export topological.sort +deprecated("topological.sort", topo_sort) +#' @export unfold.tree +deprecated("unfold.tree", unfold_tree) +#' @export get.diameter +deprecated("get.diameter", get_diameter) +#' @export get.all.shortest.paths +deprecated("get.all.shortest.paths", all_shortest_paths) +#' @export get.shortest.paths +deprecated("get.shortest.paths", shortest_paths) diff --git a/R/structure.info.R b/R/structure.info.R index 23fa1860336..71bfe5ddc08 100644 --- a/R/structure.info.R +++ b/R/structure.info.R @@ -54,3 +54,5 @@ are_adjacent <- function(graph, v1, v2) { as_igraph_vs(graph, v2) - 1 ) } +#' @export are.connected +deprecated("are.connected", are_adjacent) diff --git a/R/test.R b/R/test.R index 1fcfb06bdb7..a9938f7ee6a 100644 --- a/R/test.R +++ b/R/test.R @@ -75,3 +75,7 @@ checkpkg <- function(package_file, args = character()) { args <- as.character(args) do.call(":::", list("tools", ".check_packages"))(c(package_file, args)) } +#' @export igraph.version +deprecated("igraph.version", igraph_version) +#' @export igraphtest +deprecated("igraphtest", igraph_test) diff --git a/R/tkplot.R b/R/tkplot.R index 93cae8bb732..118e57cce1b 100644 --- a/R/tkplot.R +++ b/R/tkplot.R @@ -1831,3 +1831,23 @@ i.tkplot.get.edge.lty <- function(edge.lty) { } edge.lty } +#' @export tkplot.canvas +deprecated("tkplot.canvas", tk_canvas) +#' @export tkplot.center +deprecated("tkplot.center", tk_center) +#' @export tkplot.close +deprecated("tkplot.close", tk_close) +#' @export tkplot.export.postscript +deprecated("tkplot.export.postscript", tk_postscript) +#' @export tkplot.fit.to.screen +deprecated("tkplot.fit.to.screen", tk_fit) +#' @export tkplot.getcoords +deprecated("tkplot.getcoords", tk_coords) +#' @export tkplot.off +deprecated("tkplot.off", tk_off) +#' @export tkplot.reshape +deprecated("tkplot.reshape", tk_reshape) +#' @export tkplot.rotate +deprecated("tkplot.rotate", tk_rotate) +#' @export tkplot.setcoords +deprecated("tkplot.setcoords", tk_set_coords) diff --git a/R/topology.R b/R/topology.R index fac4e3fbee9..628c9e0d185 100644 --- a/R/topology.R +++ b/R/topology.R @@ -945,3 +945,13 @@ count_automorphisms <- automorphisms_impl #' @family graph automorphism #' @export automorphism_group <- automorphism_group_impl +#' @export automorphisms +deprecated("automorphisms", count_automorphisms) +#' @export canonical.permutation +deprecated("canonical.permutation", canonical_permutation) +#' @export graph.automorphisms +deprecated("graph.automorphisms", count_automorphisms) +#' @export graph.isocreate +deprecated("graph.isocreate", graph_from_isomorphism_class) +#' @export permute.vertices +deprecated("permute.vertices", permute) diff --git a/R/triangles.R b/R/triangles.R index 39c7dab640a..4dd3db85cef 100644 --- a/R/triangles.R +++ b/R/triangles.R @@ -75,3 +75,5 @@ triangles <- list_triangles_impl #' @export #' @rdname count_triangles count_triangles <- adjacent_triangles_impl +#' @export adjacent.triangles +deprecated("adjacent.triangles", count_triangles) diff --git a/R/zzz-deprecate.R b/R/zzz-deprecate.R deleted file mode 100644 index 2855616994d..00000000000 --- a/R/zzz-deprecate.R +++ /dev/null @@ -1,564 +0,0 @@ - -# IGraph R package -# Copyright (C) 2014 Gabor Csardi -# 334 Harvard street, Cambridge, MA 02139 USA -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA -# -################################################################### - -## For the future, right now, we do not warn or even message - -#' @importFrom utils packageName -deprecated <- function(old, new) { - assign(old, new, envir = asNamespace(packageName())) -} - -#' @export add.edges -deprecated("add.edges", add_edges) -#' @export add.vertex.shape -deprecated("add.vertex.shape", add_shape) -#' @export add.vertices -deprecated("add.vertices", add_vertices) -#' @export adjacent.triangles -deprecated("adjacent.triangles", count_triangles) -#' @export articulation.points -deprecated("articulation.points", articulation_points) -#' @export aging.prefatt.game -deprecated("aging.prefatt.game", sample_pa_age) -#' @export aging.ba.game -deprecated("aging.ba.game", sample_pa_age) -#' @export aging.barabasi.game -deprecated("aging.barabasi.game", sample_pa_age) -#' @export alpha.centrality -deprecated("alpha.centrality", alpha_centrality) -#' @export are.connected -deprecated("are.connected", are_adjacent) -#' @export assortativity.degree -deprecated("assortativity.degree", assortativity_degree) -#' @export assortativity.nominal -deprecated("assortativity.nominal", assortativity_nominal) -#' @export asymmetric.preference.game -deprecated("asymmetric.preference.game", sample_asym_pref) -#' @export authority.score -deprecated("authority.score", authority_score) -#' @export automorphisms -deprecated("automorphisms", count_automorphisms) -#' @export autocurve.edges -deprecated("autocurve.edges", curve_multiple) -#' @export average.path.length -deprecated("average.path.length", mean_distance) - -#' @export ba.game -deprecated("ba.game", sample_pa) -#' @export barabasi.game -deprecated("barabasi.game", sample_pa) -#' @export biconnected.components -deprecated("biconnected.components", biconnected_components) -#' @export bipartite.mapping -deprecated("bipartite.mapping", bipartite_mapping) -#' @export bipartite.projection -deprecated("bipartite.projection", bipartite_projection) -#' @export bipartite.projection.size -deprecated("bipartite.projection.size", bipartite_projection_size) -#' @export bipartite.random.game -deprecated("bipartite.random.game", sample_bipartite) -#' @export blockGraphs -deprecated("blockGraphs", graphs_from_cohesive_blocks) -#' @export bonpow -deprecated("bonpow", power_centrality) - -#' @export callaway.traits.game -deprecated("callaway.traits.game", sample_traits_callaway) -#' @export canonical.permutation -deprecated("canonical.permutation", canonical_permutation) -#' @export centralization.betweenness -deprecated("centralization.betweenness", centr_betw) -#' @export centralization.betweenness.tmax -deprecated("centralization.betweenness.tmax", centr_betw_tmax) -#' @export centralization.closeness -deprecated("centralization.closeness", centr_clo) -#' @export centralization.closeness.tmax -deprecated("centralization.closeness.tmax", centr_clo_tmax) -#' @export centralization.degree -deprecated("centralization.degree", centr_degree) -#' @export centralization.degree.tmax -deprecated("centralization.degree.tmax", centr_degree_tmax) -#' @export centralization.evcent -deprecated("centralization.evcent", centr_eigen) -#' @export centralization.evcent.tmax -deprecated("centralization.evcent.tmax", centr_eigen_tmax) -#' @export centralize.scores -deprecated("centralize.scores", centralize) -#' @export cited.type.game -deprecated("cited.type.game", sample_cit_types) -#' @export citing.cited.type.game -deprecated("citing.cited.type.game", sample_cit_cit_types) -#' @export clique.number -deprecated("clique.number", clique_num) -#' @export cluster.distribution -deprecated("cluster.distribution", component_distribution) -#' @export clusters -deprecated("clusters", components) -#' @export code.length -deprecated("code.length", code_len) -#' @export cohesive.blocks -deprecated("cohesive.blocks", cohesive_blocks) -#' @export connect.neighborhood -deprecated("connect.neighborhood", connect) -#' @export contract.vertices -deprecated("contract.vertices", contract) -#' @export convex.hull -deprecated("convex.hull", convex_hull) -#' @export count.multiple -deprecated("count.multiple", count_multiple) -#' @export cutat -deprecated("cutat", cut_at) - -#' @export decompose.graph -deprecated("decompose.graph", decompose) -#' @export degree.distribution -deprecated("degree.distribution", degree_distribution) -#' @export degree.sequence.game -deprecated("degree.sequence.game", sample_degseq) -#' @export delete.edges -deprecated("delete.edges", delete_edges) -#' @export delete.vertices -deprecated("delete.vertices", delete_vertices) -#' @export dendPlot -deprecated("dendPlot", plot_dendrogram) -#' @method dendPlot communities -deprecated("dendPlot.communities", plot_dendrogram.communities) -#' @method dendPlot igraphHRG -deprecated("dendPlot.igraphHRG", plot_dendrogram.igraphHRG) -#' @export dominator.tree -deprecated("dominator.tree", dominator_tree) -#' @export dyad.census -deprecated("dyad.census", dyad_census) - -#' @export edge.betweenness -deprecated("edge.betweenness", edge_betweenness) -#' @export edge.betweenness.community -deprecated("edge.betweenness.community", cluster_edge_betweenness) -#' @export edge.connectivity -deprecated("edge.connectivity", edge_connectivity) -#' @export edge.disjoint.paths -deprecated("edge.disjoint.paths", edge_connectivity) -#' @export establishment.game -deprecated("establishment.game", sample_traits) -#' @export evcent -deprecated("evcent", eigen_centrality) - -#' @export farthest.nodes -deprecated("farthest.nodes", farthest_vertices) -#' @export fastgreedy.community -deprecated("fastgreedy.community", cluster_fast_greedy) -#' @export forest.fire.game -deprecated("forest.fire.game", sample_forestfire) - -#' @export get.adjedgelist -deprecated("get.adjedgelist", as_adj_edge_list) -#' @export get.adjlist -deprecated("get.adjlist", as_adj_list) -#' @export get.adjacency -deprecated("get.adjacency", as_adjacency_matrix) -#' @export get.data.frame -deprecated("get.data.frame", as_data_frame) -#' @export get.edge.attribute -deprecated("get.edge.attribute", edge_attr) -#' @export get.edgelist -deprecated("get.edgelist", as_edgelist) -#' @export get.graph.attribute -deprecated("get.graph.attribute", graph_attr) -#' @export get.incidence -deprecated("get.incidence", as_biadjacency_matrix) -#' @export get.stochastic -deprecated("get.stochastic", stochastic_matrix) -#' @export get.vertex.attribute -deprecated("get.vertex.attribute", vertex_attr) -#' @export graph.adhesion -deprecated("graph.adhesion", adhesion) -#' @export graph.adjacency -deprecated("graph.adjacency", graph_from_adjacency_matrix) -#' @export graph.adjlist -deprecated("graph.adjlist", graph_from_adj_list) -#' @export graph.atlas -deprecated("graph.atlas", graph_from_atlas) -#' @export graph.automorphisms -deprecated("graph.automorphisms", count_automorphisms) -#' @export graph.bfs -deprecated("graph.bfs", bfs) -#' @export graph.bipartite -deprecated("graph.bipartite", make_bipartite_graph) -#' @export graph.cohesion -deprecated("graph.cohesion", cohesion) -#' @export graph.complementer -deprecated("graph.complementer", complementer) -#' @export graph.compose -deprecated("graph.compose", compose) -#' @export graph.coreness -deprecated("graph.coreness", coreness) -#' @export graph.data.frame -deprecated("graph.data.frame", graph_from_data_frame) -#' @export graph.de.bruijn -deprecated("graph.de.bruijn", make_de_bruijn_graph) -#' @export graph.density -deprecated("graph.density", edge_density) -#' @export graph.disjoint.union -deprecated("graph.disjoint.union", disjoint_union) -#' @export graph.dfs -deprecated("graph.dfs", dfs) -#' @export graph.difference -deprecated("graph.difference", difference) -#' @export graph.diversity -deprecated("graph.diversity", diversity) -#' @export graph.edgelist -deprecated("graph.edgelist", graph_from_edgelist) -#' @export graph.eigen -deprecated("graph.eigen", spectrum) -#' @export graph.empty -deprecated("graph.empty", make_empty_graph) -#' @export graph.extended.chordal.ring -deprecated("graph.extended.chordal.ring", make_chordal_ring) -#' @export graph.formula -deprecated("graph.formula", graph_from_literal) -#' @export graph.full -deprecated("graph.full", make_full_graph) -#' @export graph.full.bipartite -deprecated("graph.full.bipartite", make_full_bipartite_graph) -#' @export graph.full.citation -deprecated("graph.full.citation", make_full_citation_graph) -#' @export graph.graphdb -deprecated("graph.graphdb", graph_from_graphdb) -#' @export graph.incidence -deprecated("graph.incidence", graph_from_biadjacency_matrix) -#' @export graph.isocreate -deprecated("graph.isocreate", graph_from_isomorphism_class) -#' @export graph.kautz -deprecated("graph.kautz", make_kautz_graph) -#' @export graph.knn -deprecated("graph.knn", knn) -#' @export graph.laplacian -deprecated("graph.laplacian", laplacian_matrix) -#' @export graph.lattice -deprecated("graph.lattice", make_lattice) -#' @export graph.lcf -deprecated("graph.lcf", graph_from_lcf) -#' @export graph.maxflow -deprecated("graph.maxflow", max_flow) -#' @export graph.mincut -deprecated("graph.mincut", min_cut) -#' @export graph.motifs -deprecated("graph.motifs", motifs) -#' @export graph.motifs.est -deprecated("graph.motifs.est", sample_motifs) -#' @export graph.motifs.no -deprecated("graph.motifs.no", count_motifs) -#' @export graph.neighborhood -deprecated("graph.neighborhood", make_ego_graph) -#' @export graph.star -deprecated("graph.star", make_star) -#' @export graph.strength -deprecated("graph.strength", strength) -#' @export graph.tree -deprecated("graph.tree", make_tree) -#' @export graph.union -deprecated("graph.union", union.igraph) -#' @export graph.ring -deprecated("graph.ring", make_ring) -#' @export graphlets.candidate.basis -deprecated("graphlets.candidate.basis", graphlet_basis) -#' @export graphlets.project -deprecated("graphlets.project", graphlet_proj) -#' @export growing.random.game -deprecated("growing.random.game", sample_growing) -#' @export grg.game -deprecated("grg.game", sample_grg) - -#' @export has.multiple -deprecated("has.multiple", any_multiple) -#' @export hrg.consensus -deprecated("hrg.consensus", consensus_tree) -#' @export hrg.create -deprecated("hrg.create", hrg) -#' @export hrg.dendrogram -deprecated("hrg.dendrogram", hrg_tree) -#' @export hrg.game -deprecated("hrg.game", sample_hrg) -#' @export hrg.fit -deprecated("hrg.fit", fit_hrg) -#' @export hrg.predict -deprecated("hrg.predict", predict_edges) -#' @export hub.score -deprecated("hub.score", hub_score) - -#' @export igraph.console -deprecated("igraph.console", console) -#' @export igraph.sample -deprecated("igraph.sample", sample_seq) -#' @export igraph.version -deprecated("igraph.version", igraph_version) -#' @export igraphdemo -deprecated("igraphdemo", igraph_demo) -#' @export igraphtest -deprecated("igraphtest", igraph_test) -#' @export independence.number -deprecated("independence.number", ivs_size) -#' @export independent.vertex.sets -deprecated("independent.vertex.sets", ivs) -#' @export infomap.community -deprecated("infomap.community", cluster_infomap) -#' @export induced.subgraph -deprecated("induced.subgraph", induced_subgraph) -#' @export interconnected.islands.game -deprecated("interconnected.islands.game", sample_islands) -#' @export is.bipartite -deprecated("is.bipartite", is_bipartite) -#' @export is.chordal -deprecated("is.chordal", is_chordal) -#' @export is.connected -deprecated("is.connected", is_connected) -#' @export is.dag -deprecated("is.dag", is_dag) -#' @export is.degree.sequence -deprecated("is.degree.sequence", is_degseq) -#' @export is.directed -deprecated("is.directed", is_directed) -#' @export is.graphical.degree.sequence -deprecated("is.graphical.degree.sequence", is_graphical) -#' @export is.hierarchical -deprecated("is.hierarchical", is_hierarchical) -#' @export is.igraph -deprecated("is.igraph", is_igraph) -#' @export is.loop -deprecated("is.loop", which_loop) -#' @export is.matching -deprecated("is.matching", is_matching) -#' @export is.maximal.matching -deprecated("is.maximal.matching", is_max_matching) -#' @export is.minimal.separator -deprecated("is.minimal.separator", is_min_separator) -#' @export is.multiple -deprecated("is.multiple", which_multiple) -#' @export is.mutual -deprecated("is.mutual", which_mutual) -#' @export is.named -deprecated("is.named", is_named) -#' @export is.separator -deprecated("is.separator", is_separator) -#' @export is.simple -deprecated("is.simple", is_simple) -#' @export is.weighted -deprecated("is.weighted", is_weighted) - -#' @export k.regular.game -deprecated("k.regular.game", sample_k_regular) - -#' @export label.propagation.community -deprecated("label.propagation.community", cluster_label_prop) -#' @export largest.cliques -deprecated("largest.cliques", largest_cliques) -#' @export largest.independent.vertex.sets -deprecated("largest.independent.vertex.sets", largest_ivs) -#' @export lastcit.game -deprecated("lastcit.game", sample_last_cit) -#' @export layout.auto -deprecated("layout.auto", layout_nicely) -#' @export layout.bipartite -deprecated("layout.bipartite", layout_as_bipartite) -#' @export layout.davidson.harel -deprecated("layout.davidson.harel", layout_with_dh) -#' @export layout.drl -deprecated("layout.drl", layout_with_drl) -#' @export layout.gem -deprecated("layout.gem", layout_with_gem) -#' @export layout.graphopt -deprecated("layout.graphopt", layout_with_graphopt) -#' @export layout.grid -deprecated("layout.grid", layout_on_grid) -#' @export layout.mds -deprecated("layout.mds", layout_with_mds) -#' @export layout.merge -deprecated("layout.merge", merge_coords) -#' @export layout.norm -deprecated("layout.norm", norm_coords) -#' @export layout.star -deprecated("layout.star", layout_as_star) -#' @export layout.sugiyama -deprecated("layout.sugiyama", layout_with_sugiyama) -#' @export leading.eigenvector.community -deprecated("leading.eigenvector.community", cluster_leading_eigen) -#' @export line.graph -deprecated("line.graph", make_line_graph) -#' @export list.edge.attributes -deprecated("list.edge.attributes", edge_attr_names) -#' @export list.graph.attributes -deprecated("list.graph.attributes", graph_attr_names) -#' @export list.vertex.attributes -deprecated("list.vertex.attributes", vertex_attr_names) - -#' @export maxcohesion -deprecated("maxcohesion", max_cohesion) -#' @export maximal.cliques -deprecated("maximal.cliques", max_cliques) -#' @export maximal.cliques.count -deprecated("maximal.cliques.count", count_max_cliques) -#' @export maximal.independent.vertex.sets -deprecated("maximal.independent.vertex.sets", maximal_ivs) -#' @export minimal.st.separators -deprecated("minimal.st.separators", min_st_separators) -#' @export maximum.bipartite.matching -deprecated("maximum.bipartite.matching", max_bipartite_match) -#' @export maximum.cardinality.search -deprecated("maximum.cardinality.search", max_cardinality) -#' @export minimum.size.separators -deprecated("minimum.size.separators", min_separators) -#' @export minimum.spanning.tree -deprecated("minimum.spanning.tree", mst) -#' @export mod.matrix -deprecated("mod.matrix", modularity_matrix) -#' @export multilevel.community -deprecated("multilevel.community", cluster_louvain) - -#' @export neighborhood.size -deprecated("neighborhood.size", ego_size) -#' @export no.clusters -deprecated("no.clusters", count_components) - -#' @export optimal.community -deprecated("optimal.community", cluster_optimal) - -#' @export page.rank -deprecated("page.rank", page_rank) -#' @export path.length.hist -deprecated("path.length.hist", distance_table) -#' @export permute.vertices -deprecated("permute.vertices", permute) -#' @export piecewise.layout -deprecated("piecewise.layout", layout_components) -#' @export plotHierarchy -deprecated("plotHierarchy", plot_hierarchy) -#' @export power.law.fit -deprecated("power.law.fit", fit_power_law) -#' @export preference.game -deprecated("preference.game", sample_pref) - -#' @export read.graph -deprecated("read.graph", read_graph) -#' @export remove.edge.attribute -deprecated("remove.edge.attribute", delete_edge_attr) -#' @export remove.graph.attribute -deprecated("remove.graph.attribute", delete_graph_attr) -#' @export remove.vertex.attribute -deprecated("remove.vertex.attribute", delete_vertex_attr) -#' @export running.mean -deprecated("running.mean", running_mean) - -#' @export sbm.game -deprecated("sbm.game", sample_sbm) -#' @export set.edge.attribute -deprecated("set.edge.attribute", set_edge_attr) -#' @export set.graph.attribute -deprecated("set.graph.attribute", set_graph_attr) -#' @export set.vertex.attribute -deprecated("set.vertex.attribute", set_vertex_attr) -#' @export shortest.paths -deprecated("shortest.paths", distances) -#' @export showtrace -deprecated("showtrace", show_trace) -#' @export spinglass.community -deprecated("spinglass.community", cluster_spinglass) -#' @export stCuts -deprecated("stCuts", st_cuts) -#' @export stMincuts -deprecated("stMincuts", st_min_cuts) -#' @export static.fitness.game -deprecated("static.fitness.game", sample_fitness) -#' @export static.power.law.game -deprecated("static.power.law.game", sample_fitness_pl) -#' @export subgraph.centrality -deprecated("subgraph.centrality", subgraph_centrality) - -#' @export tkplot.canvas -deprecated("tkplot.canvas", tk_canvas) -#' @export tkplot.center -deprecated("tkplot.center", tk_center) -#' @export tkplot.close -deprecated("tkplot.close", tk_close) -#' @export tkplot.export.postscript -deprecated("tkplot.export.postscript", tk_postscript) -#' @export tkplot.fit.to.screen -deprecated("tkplot.fit.to.screen", tk_fit) -#' @export tkplot.getcoords -deprecated("tkplot.getcoords", tk_coords) -#' @export tkplot.off -deprecated("tkplot.off", tk_off) -#' @export tkplot.reshape -deprecated("tkplot.reshape", tk_reshape) -#' @export tkplot.rotate -deprecated("tkplot.rotate", tk_rotate) -#' @export tkplot.setcoords -deprecated("tkplot.setcoords", tk_set_coords) - -#' @export topological.sort -deprecated("topological.sort", topo_sort) -#' @export triad.census -deprecated("triad.census", triad_census) - -#' @export unfold.tree -deprecated("unfold.tree", unfold_tree) - -#' @export vertex.connectivity -deprecated("vertex.connectivity", vertex_connectivity) -#' @export vertex.disjoint.paths -deprecated("vertex.disjoint.paths", vertex_disjoint_paths) - -#' @export walktrap.community -deprecated("walktrap.community", cluster_walktrap) -#' @export watts.strogatz.game -deprecated("watts.strogatz.game", sample_smallworld) -#' @export write.graph -deprecated("write.graph", write_graph) -#' @export graph.famous -deprecated("graph.famous", make_graph) -#' @export igraph.from.graphNEL -deprecated("igraph.from.graphNEL", graph_from_graphnel) -#' @export igraph.to.graphNEL -deprecated("igraph.to.graphNEL", as_graphnel) -#' @export getIgraphOpt -deprecated("getIgraphOpt", igraph_opt) -#' @export igraph.options -deprecated("igraph.options", igraph_options) -#' @export graph.intersection -deprecated("graph.intersection", intersection) -#' @export exportPajek -deprecated("exportPajek", export_pajek) -#' @export get.diameter -deprecated("get.diameter", get_diameter) -#' @export get.all.shortest.paths -deprecated("get.all.shortest.paths", all_shortest_paths) -#' @export get.shortest.paths -deprecated("get.shortest.paths", shortest_paths) -#' @export graph -deprecated("graph", make_graph) -#' @export vertex.shapes -deprecated("vertex.shapes", shapes) -#' @export igraph.shape.noclip -deprecated("igraph.shape.noclip", shape_noclip) -#' @export igraph.shape.noplot -deprecated("igraph.shape.noplot", shape_noplot) -#' @export create.communities -deprecated("create.communities", make_clusters) From efde49fd2342bb4f7c7132f61d302514c6224ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:51:34 +0100 Subject: [PATCH 04/48] refactor!: change R/adjacency.R --- R/adjacency.R | 17 +++++++-- man/graph.adjacency.Rd | 57 ++++++++++++++++++++++++++++++ man/graph_from_adjacency_matrix.Rd | 1 - 3 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 man/graph.adjacency.Rd diff --git a/R/adjacency.R b/R/adjacency.R index f94c0846f09..03dd794e41d 100644 --- a/R/adjacency.R +++ b/R/adjacency.R @@ -1,4 +1,19 @@ +#' Create graphs from adjacency matrices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.adjacency()` was renamed to `graph_from_adjacency_matrix()` to create a more +#' consistent API. +#' @inheritParams graph_from_adjacency_matrix +#' @keywords internal +#' @export +graph.adjacency <- function(adjmatrix , mode = c("directed","undirected","max","min","upper","lower","plus") , weighted = NULL , diag = TRUE , add.colnames = NULL , add.rownames = NA) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.adjacency()", "graph_from_adjacency_matrix()") + graph_from_adjacency_matrix(adjmatrix = adjmatrix, mode = mode, weighted = weighted, diag = diag, add.colnames = add.colnames, add.rownames = add.rownames) +} # nocov end + ## ---------------------------------------------------------------- ## ## IGraph R package @@ -276,7 +291,6 @@ graph.adjacency.sparse <- function(adjmatrix, mode, weighted = NULL, diag = TRUE #' undirected graph will be created, `A(i,j)+A(j,i)` gives the edge #' weights.} } #' -#' @aliases graph.adjacency #' @param adjmatrix A square adjacency matrix. From igraph version 0.5.1 this #' can be a sparse matrix created with the `Matrix` package. #' @param mode Character scalar, specifies how igraph should interpret the @@ -456,4 +470,3 @@ is_symmetric <- function(x) { #' @export from_adjacency <- function(...) constructor_spec(graph_from_adjacency_matrix, ...) #' @export graph.adjacency -deprecated("graph.adjacency", graph_from_adjacency_matrix) diff --git a/man/graph.adjacency.Rd b/man/graph.adjacency.Rd new file mode 100644 index 00000000000..70609e73bd8 --- /dev/null +++ b/man/graph.adjacency.Rd @@ -0,0 +1,57 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/adjacency.R +\name{graph.adjacency} +\alias{graph.adjacency} +\title{Create graphs from adjacency matrices} +\usage{ +graph.adjacency( + adjmatrix, + mode = c("directed", "undirected", "max", "min", "upper", "lower", "plus"), + weighted = NULL, + diag = TRUE, + add.colnames = NULL, + add.rownames = NA +) +} +\arguments{ +\item{adjmatrix}{A square adjacency matrix. From igraph version 0.5.1 this +can be a sparse matrix created with the \code{Matrix} package.} + +\item{mode}{Character scalar, specifies how igraph should interpret the +supplied matrix. See also the \code{weighted} argument, the interpretation +depends on that too. Possible values are: \code{directed}, +\code{undirected}, \code{upper}, \code{lower}, \code{max}, \code{min}, +\code{plus}. See details below.} + +\item{weighted}{This argument specifies whether to create a weighted graph +from an adjacency matrix. If it is \code{NULL} then an unweighted graph is +created and the elements of the adjacency matrix gives the number of edges +between the vertices. If it is a character constant then for every non-zero +matrix entry an edge is created and the value of the entry is added as an +edge attribute named by the \code{weighted} argument. If it is \code{TRUE} +then a weighted graph is created and the name of the edge attribute will be +\code{weight}. See also details below.} + +\item{diag}{Logical scalar, whether to include the diagonal of the matrix in +the calculation. If this is \code{FALSE} then the diagonal is zerod out +first.} + +\item{add.colnames}{Character scalar, whether to add the column names as +vertex attributes. If it is \sQuote{\code{NULL}} (the default) then, if +present, column names are added as vertex attribute \sQuote{name}. If +\sQuote{\code{NA}} then they will not be added. If a character constant, +then it gives the name of the vertex attribute to add.} + +\item{add.rownames}{Character scalar, whether to add the row names as vertex +attributes. Possible values the same as the previous argument. By default +row names are not added. If \sQuote{\code{add.rownames}} and +\sQuote{\code{add.colnames}} specify the same vertex attribute, then the +former is ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.adjacency()} was renamed to \code{graph_from_adjacency_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_adjacency_matrix.Rd b/man/graph_from_adjacency_matrix.Rd index 7cb576779a9..6fcea554132 100644 --- a/man/graph_from_adjacency_matrix.Rd +++ b/man/graph_from_adjacency_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/adjacency.R \name{graph_from_adjacency_matrix} \alias{graph_from_adjacency_matrix} -\alias{graph.adjacency} \alias{from_adjacency} \title{Create graphs from adjacency matrices} \usage{ From 84554f1380c53070360e08b825b0d02dd16a8fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:52:02 +0100 Subject: [PATCH 05/48] refactor!: change R/assortativity.R --- R/assortativity.R | 35 +++++++++++++++++++++++++++++++---- man/assortativity.Rd | 2 -- man/assortativity.degree.Rd | 26 ++++++++++++++++++++++++++ man/assortativity.nominal.Rd | 30 ++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 man/assortativity.degree.Rd create mode 100644 man/assortativity.nominal.Rd diff --git a/R/assortativity.R b/R/assortativity.R index 416299b3080..8494e09d18f 100644 --- a/R/assortativity.R +++ b/R/assortativity.R @@ -1,4 +1,34 @@ +#' Assortativity coefficient +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `assortativity.nominal()` was renamed to `assortativity_nominal()` to create a more +#' consistent API. +#' @inheritParams assortativity_nominal +#' @keywords internal +#' @export +assortativity.nominal <- function(graph , types , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "assortativity.nominal()", "assortativity_nominal()") + assortativity_nominal(graph = graph, types = types, directed = directed) +} # nocov end + +#' Assortativity coefficient +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `assortativity.degree()` was renamed to `assortativity_degree()` to create a more +#' consistent API. +#' @inheritParams assortativity_degree +#' @keywords internal +#' @export +assortativity.degree <- function(graph , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "assortativity.degree()", "assortativity_degree()") + assortativity_degree(graph = graph, directed = directed) +} # nocov end + ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -68,7 +98,7 @@ #' `assortativity_degree()` uses vertex degree (minus one) as vertex values #' and calls `assortativity()`. #' -#' @aliases assortativity assortativity.degree assortativity.nominal +#' @aliases assortativity #' @param graph The input graph, it can be directed or undirected. #' @param values The vertex values, these can be arbitrary numeric values. #' @inheritParams rlang::args_dots_empty @@ -171,6 +201,3 @@ assortativity_nominal <- assortativity_nominal_impl #' @export assortativity_degree <- assortativity_degree_impl #' @export assortativity.degree -deprecated("assortativity.degree", assortativity_degree) -#' @export assortativity.nominal -deprecated("assortativity.nominal", assortativity_nominal) diff --git a/man/assortativity.Rd b/man/assortativity.Rd index a1e83a6693f..c2fc452265a 100644 --- a/man/assortativity.Rd +++ b/man/assortativity.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/assortativity.R \name{assortativity} \alias{assortativity} -\alias{assortativity.degree} -\alias{assortativity.nominal} \alias{assortativity_nominal} \alias{assortativity_degree} \title{Assortativity coefficient} diff --git a/man/assortativity.degree.Rd b/man/assortativity.degree.Rd new file mode 100644 index 00000000000..e79639b9d04 --- /dev/null +++ b/man/assortativity.degree.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/assortativity.R +\name{assortativity.degree} +\alias{assortativity.degree} +\title{Assortativity coefficient} +\usage{ +assortativity.degree(graph, directed = TRUE) +} +\arguments{ +\item{graph}{The input graph, it can be directed or undirected.} + +\item{directed}{Logical scalar, whether to consider edge directions for +directed graphs. +This argument is ignored for undirected graphs. +Supply +\code{TRUE} here to do the natural thing, i.e. use directed version of the +measure for directed graphs and the undirected version for undirected +graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{assortativity.degree()} was renamed to \code{assortativity_degree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/assortativity.nominal.Rd b/man/assortativity.nominal.Rd new file mode 100644 index 00000000000..9cd8ac9936a --- /dev/null +++ b/man/assortativity.nominal.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/assortativity.R +\name{assortativity.nominal} +\alias{assortativity.nominal} +\title{Assortativity coefficient} +\usage{ +assortativity.nominal(graph, types, directed = TRUE) +} +\arguments{ +\item{graph}{The input graph, it can be directed or undirected.} + +\item{types}{Vector giving the vertex types. They as assumed to be integer +numbers, starting with one. Non-integer values are converted to integers +with \code{\link[=as.integer]{as.integer()}}.} + +\item{directed}{Logical scalar, whether to consider edge directions for +directed graphs. +This argument is ignored for undirected graphs. +Supply +\code{TRUE} here to do the natural thing, i.e. use directed version of the +measure for directed graphs and the undirected version for undirected +graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{assortativity.nominal()} was renamed to \code{assortativity_nominal()} to create a more +consistent API. +} +\keyword{internal} From bf9c8f05b276834226a86c34e845c66e60c06797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:52:32 +0100 Subject: [PATCH 06/48] refactor!: change R/attributes.R --- R/attributes.R | 272 +++++++++++++++++++++++++++------ man/delete_edge_attr.Rd | 1 - man/delete_graph_attr.Rd | 1 - man/delete_vertex_attr.Rd | 1 - man/edge_attr.Rd | 1 - man/edge_attr_names.Rd | 1 - man/get.edge.attribute.Rd | 24 +++ man/get.graph.attribute.Rd | 21 +++ man/get.vertex.attribute.Rd | 24 +++ man/graph_attr.Rd | 1 - man/graph_attr_names.Rd | 1 - man/is.bipartite.Rd | 18 +++ man/is.named.Rd | 18 +++ man/is.weighted.Rd | 18 +++ man/is_named.Rd | 1 - man/is_weighted.Rd | 1 - man/list.edge.attributes.Rd | 18 +++ man/list.graph.attributes.Rd | 18 +++ man/list.vertex.attributes.Rd | 18 +++ man/remove.edge.attribute.Rd | 20 +++ man/remove.graph.attribute.Rd | 20 +++ man/remove.vertex.attribute.Rd | 20 +++ man/set.edge.attribute.Rd | 27 ++++ man/set.graph.attribute.Rd | 22 +++ man/set.vertex.attribute.Rd | 27 ++++ man/set_edge_attr.Rd | 1 - man/set_graph_attr.Rd | 1 - man/set_vertex_attr.Rd | 1 - man/vertex_attr.Rd | 1 - man/vertex_attr_names.Rd | 1 - 30 files changed, 542 insertions(+), 57 deletions(-) create mode 100644 man/get.edge.attribute.Rd create mode 100644 man/get.graph.attribute.Rd create mode 100644 man/get.vertex.attribute.Rd create mode 100644 man/is.bipartite.Rd create mode 100644 man/is.named.Rd create mode 100644 man/is.weighted.Rd create mode 100644 man/list.edge.attributes.Rd create mode 100644 man/list.graph.attributes.Rd create mode 100644 man/list.vertex.attributes.Rd create mode 100644 man/remove.edge.attribute.Rd create mode 100644 man/remove.graph.attribute.Rd create mode 100644 man/remove.vertex.attribute.Rd create mode 100644 man/set.edge.attribute.Rd create mode 100644 man/set.graph.attribute.Rd create mode 100644 man/set.vertex.attribute.Rd diff --git a/R/attributes.R b/R/attributes.R index 9b203acaccf..6478afa17a5 100644 --- a/R/attributes.R +++ b/R/attributes.R @@ -1,3 +1,228 @@ + +#' Set vertex attributes +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `set.vertex.attribute()` was renamed to `set_vertex_attr()` to create a more +#' consistent API. +#' @inheritParams set_vertex_attr +#' @keywords internal +#' @export +set.vertex.attribute <- function(graph , name , index = V(graph) , value) { # nocov start + lifecycle::deprecate_soft("1.6.0", "set.vertex.attribute()", "set_vertex_attr()") + set_vertex_attr(graph = graph, name = name, index = index, value = value) +} # nocov end + +#' Set a graph attribute +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `set.graph.attribute()` was renamed to `set_graph_attr()` to create a more +#' consistent API. +#' @inheritParams set_graph_attr +#' @keywords internal +#' @export +set.graph.attribute <- function(graph , name , value) { # nocov start + lifecycle::deprecate_soft("1.6.0", "set.graph.attribute()", "set_graph_attr()") + set_graph_attr(graph = graph, name = name, value = value) +} # nocov end + +#' Set edge attributes +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `set.edge.attribute()` was renamed to `set_edge_attr()` to create a more +#' consistent API. +#' @inheritParams set_edge_attr +#' @keywords internal +#' @export +set.edge.attribute <- function(graph , name , index = E(graph) , value) { # nocov start + lifecycle::deprecate_soft("1.6.0", "set.edge.attribute()", "set_edge_attr()") + set_edge_attr(graph = graph, name = name, index = index, value = value) +} # nocov end + +#' Delete a vertex attribute +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `remove.vertex.attribute()` was renamed to `delete_vertex_attr()` to create a more +#' consistent API. +#' @inheritParams delete_vertex_attr +#' @keywords internal +#' @export +remove.vertex.attribute <- function(graph , name) { # nocov start + lifecycle::deprecate_soft("1.6.0", "remove.vertex.attribute()", "delete_vertex_attr()") + delete_vertex_attr(graph = graph, name = name) +} # nocov end + +#' Delete a graph attribute +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `remove.graph.attribute()` was renamed to `delete_graph_attr()` to create a more +#' consistent API. +#' @inheritParams delete_graph_attr +#' @keywords internal +#' @export +remove.graph.attribute <- function(graph , name) { # nocov start + lifecycle::deprecate_soft("1.6.0", "remove.graph.attribute()", "delete_graph_attr()") + delete_graph_attr(graph = graph, name = name) +} # nocov end + +#' Delete an edge attribute +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `remove.edge.attribute()` was renamed to `delete_edge_attr()` to create a more +#' consistent API. +#' @inheritParams delete_edge_attr +#' @keywords internal +#' @export +remove.edge.attribute <- function(graph , name) { # nocov start + lifecycle::deprecate_soft("1.6.0", "remove.edge.attribute()", "delete_edge_attr()") + delete_edge_attr(graph = graph, name = name) +} # nocov end + +#' List names of vertex attributes +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `list.vertex.attributes()` was renamed to `vertex_attr_names()` to create a more +#' consistent API. +#' @inheritParams vertex_attr_names +#' @keywords internal +#' @export +list.vertex.attributes <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "list.vertex.attributes()", "vertex_attr_names()") + vertex_attr_names(graph = graph) +} # nocov end + +#' List names of graph attributes +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `list.graph.attributes()` was renamed to `graph_attr_names()` to create a more +#' consistent API. +#' @inheritParams graph_attr_names +#' @keywords internal +#' @export +list.graph.attributes <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "list.graph.attributes()", "graph_attr_names()") + graph_attr_names(graph = graph) +} # nocov end + +#' List names of edge attributes +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `list.edge.attributes()` was renamed to `edge_attr_names()` to create a more +#' consistent API. +#' @inheritParams edge_attr_names +#' @keywords internal +#' @export +list.edge.attributes <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "list.edge.attributes()", "edge_attr_names()") + edge_attr_names(graph = graph) +} # nocov end + +#' Weighted graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.weighted()` was renamed to `is_weighted()` to create a more +#' consistent API. +#' @inheritParams is_weighted +#' @keywords internal +#' @export +is.weighted <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.weighted()", "is_weighted()") + is_weighted(graph = graph) +} # nocov end + +#' Named graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.named()` was renamed to `is_named()` to create a more +#' consistent API. +#' @inheritParams is_named +#' @keywords internal +#' @export +is.named <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.named()", "is_named()") + is_named(graph = graph) +} # nocov end + +#' Create a bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.bipartite()` was renamed to `is_bipartite()` to create a more +#' consistent API. +#' @inheritParams is_bipartite +#' @keywords internal +#' @export +is.bipartite <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.bipartite()", "is_bipartite()") + is_bipartite(graph = graph) +} # nocov end + +#' Query vertex attributes of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.vertex.attribute()` was renamed to `vertex_attr()` to create a more +#' consistent API. +#' @inheritParams vertex_attr +#' @keywords internal +#' @export +get.vertex.attribute <- function(graph , name , index = V(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.vertex.attribute()", "vertex_attr()") + vertex_attr(graph = graph, name = name, index = index) +} # nocov end + +#' Graph attributes of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.graph.attribute()` was renamed to `graph_attr()` to create a more +#' consistent API. +#' @inheritParams graph_attr +#' @keywords internal +#' @export +get.graph.attribute <- function(graph , name) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.graph.attribute()", "graph_attr()") + graph_attr(graph = graph, name = name) +} # nocov end + +#' Query edge attributes of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.edge.attribute()` was renamed to `edge_attr()` to create a more +#' consistent API. +#' @inheritParams edge_attr +#' @keywords internal +#' @export +get.edge.attribute <- function(graph , name , index = E(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.edge.attribute()", "edge_attr()") + edge_attr(graph = graph, name = name, index = index) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -42,7 +267,7 @@ #' attributes are returned in a list. #' @return A list of graph attributes, or a single graph attribute. #' -#' @aliases get.graph.attribute graph.attributes +#' @aliases graph.attributes #' @family attributes #' #' @export @@ -101,7 +326,6 @@ graph_attr <- function(graph, name) { #' @return The graph with the new graph attribute added or set. #' #' @family attributes -#' @aliases set.graph.attribute #' #' @export #' @examples @@ -143,7 +367,7 @@ graph.attributes <- function(graph) { #' @return The value of the vertex attribute, or the list of #' all vertex attributes, if `name` is missing. #' -#' @aliases get.vertex.attribute vertex.attributes +#' @aliases vertex.attributes #' @family attributes #' #' @export @@ -218,7 +442,6 @@ vertex_attr <- function(graph, name, index = V(graph)) { #' If `NULL`, the input is returned unchanged. #' @return The graph, with the vertex attribute added or set. #' -#' @aliases set.vertex.attribute #' @family attributes #' #' @export @@ -353,7 +576,7 @@ vertex.attributes <- function(graph, index = V(graph)) { #' @return The value of the edge attribute, or the list of all #' edge attributes if `name` is missing. #' -#' @aliases get.edge.attribute edge.attributes +#' @aliases edge.attributes #' @family attributes #' #' @export @@ -428,7 +651,6 @@ edge_attr <- function(graph, name, index = E(graph)) { #' If `NULL`, the input is returned unchanged. #' @return The graph, with the edge attribute added or set. #' -#' @aliases set.edge.attribute #' @family attributes #' #' @export @@ -556,7 +778,7 @@ edge.attributes <- function(graph, index = E(graph)) { #' @param graph The graph. #' @return Character vector, the names of the graph attributes. #' -#' @aliases list.graph.attributes attributes +#' @aliases attributes #' @family attributes #' #' @export @@ -577,7 +799,6 @@ graph_attr_names <- function(graph) { #' @param graph The graph. #' @return Character vector, the names of the vertex attributes. #' -#' @aliases list.vertex.attributes #' @family attributes #' #' @export @@ -603,7 +824,6 @@ vertex_attr_names <- function(graph) { #' @param graph The graph. #' @return Character vector, the names of the edge attributes. #' -#' @aliases list.edge.attributes #' @family attributes #' #' @export @@ -627,7 +847,6 @@ edge_attr_names <- function(graph) { #' @param name Name of the attribute to delete. #' @return The graph, with the specified attribute removed. #' -#' @aliases remove.graph.attribute #' @family attributes #' #' @export @@ -656,7 +875,6 @@ delete_graph_attr <- function(graph, name) { #' @param name The name of the vertex attribute to delete. #' @return The graph, with the specified vertex attribute removed. #' -#' @aliases remove.vertex.attribute #' @family attributes #' #' @export @@ -686,7 +904,6 @@ delete_vertex_attr <- function(graph, name) { #' @param name The name of the edge attribute to delete. #' @return The graph, with the specified edge attribute removed. #' -#' @aliases remove.edge.attribute #' @family attributes #' #' @export @@ -731,7 +948,6 @@ delete_edge_attr <- function(graph, name) { #' igraph, you have to check that for yourself, when assigning the vertex #' names. #' -#' @aliases is.named #' @param graph The input graph. #' @return A logical scalar. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} @@ -769,7 +985,6 @@ is_named <- function(graph) { #' vertices, etc. Check the manual pages of the functions working with weighted #' graphs for details. #' -#' @aliases is.weighted #' @param graph The input graph. #' @return A logical scalar. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} @@ -970,32 +1185,3 @@ NULL set_graph_attr(x, name, value) } #' @export get.edge.attribute -deprecated("get.edge.attribute", edge_attr) -#' @export get.graph.attribute -deprecated("get.graph.attribute", graph_attr) -#' @export get.vertex.attribute -deprecated("get.vertex.attribute", vertex_attr) -#' @export is.bipartite -deprecated("is.bipartite", is_bipartite) -#' @export is.named -deprecated("is.named", is_named) -#' @export is.weighted -deprecated("is.weighted", is_weighted) -#' @export list.edge.attributes -deprecated("list.edge.attributes", edge_attr_names) -#' @export list.graph.attributes -deprecated("list.graph.attributes", graph_attr_names) -#' @export list.vertex.attributes -deprecated("list.vertex.attributes", vertex_attr_names) -#' @export remove.edge.attribute -deprecated("remove.edge.attribute", delete_edge_attr) -#' @export remove.graph.attribute -deprecated("remove.graph.attribute", delete_graph_attr) -#' @export remove.vertex.attribute -deprecated("remove.vertex.attribute", delete_vertex_attr) -#' @export set.edge.attribute -deprecated("set.edge.attribute", set_edge_attr) -#' @export set.graph.attribute -deprecated("set.graph.attribute", set_graph_attr) -#' @export set.vertex.attribute -deprecated("set.vertex.attribute", set_vertex_attr) diff --git a/man/delete_edge_attr.Rd b/man/delete_edge_attr.Rd index 933d737cd92..5f335d23bbb 100644 --- a/man/delete_edge_attr.Rd +++ b/man/delete_edge_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{delete_edge_attr} \alias{delete_edge_attr} -\alias{remove.edge.attribute} \title{Delete an edge attribute} \usage{ delete_edge_attr(graph, name) diff --git a/man/delete_graph_attr.Rd b/man/delete_graph_attr.Rd index cb185a78dd2..1d74b9774d5 100644 --- a/man/delete_graph_attr.Rd +++ b/man/delete_graph_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{delete_graph_attr} \alias{delete_graph_attr} -\alias{remove.graph.attribute} \title{Delete a graph attribute} \usage{ delete_graph_attr(graph, name) diff --git a/man/delete_vertex_attr.Rd b/man/delete_vertex_attr.Rd index 3852e56e992..9f77f908463 100644 --- a/man/delete_vertex_attr.Rd +++ b/man/delete_vertex_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{delete_vertex_attr} \alias{delete_vertex_attr} -\alias{remove.vertex.attribute} \title{Delete a vertex attribute} \usage{ delete_vertex_attr(graph, name) diff --git a/man/edge_attr.Rd b/man/edge_attr.Rd index 3782d289511..9c35571647a 100644 --- a/man/edge_attr.Rd +++ b/man/edge_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{edge_attr} \alias{edge_attr} -\alias{get.edge.attribute} \alias{edge.attributes} \title{Query edge attributes of a graph} \usage{ diff --git a/man/edge_attr_names.Rd b/man/edge_attr_names.Rd index c51a641cb89..12cc2d6691c 100644 --- a/man/edge_attr_names.Rd +++ b/man/edge_attr_names.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{edge_attr_names} \alias{edge_attr_names} -\alias{list.edge.attributes} \title{List names of edge attributes} \usage{ edge_attr_names(graph) diff --git a/man/get.edge.attribute.Rd b/man/get.edge.attribute.Rd new file mode 100644 index 00000000000..0a7ba9ac7ce --- /dev/null +++ b/man/get.edge.attribute.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{get.edge.attribute} +\alias{get.edge.attribute} +\title{Query edge attributes of a graph} +\usage{ +get.edge.attribute(graph, name, index = E(graph)) +} +\arguments{ +\item{graph}{The graph} + +\item{name}{The name of the attribute to query. If missing, then +all edge attributes are returned in a list.} + +\item{index}{An optional edge sequence to query edge attributes +for a subset of edges.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.edge.attribute()} was renamed to \code{edge_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.graph.attribute.Rd b/man/get.graph.attribute.Rd new file mode 100644 index 00000000000..71fff1eac3f --- /dev/null +++ b/man/get.graph.attribute.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{get.graph.attribute} +\alias{get.graph.attribute} +\title{Graph attributes of a graph} +\usage{ +get.graph.attribute(graph, name) +} +\arguments{ +\item{graph}{Input graph.} + +\item{name}{The name of attribute to query. If missing, then all +attributes are returned in a list.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.graph.attribute()} was renamed to \code{graph_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.vertex.attribute.Rd b/man/get.vertex.attribute.Rd new file mode 100644 index 00000000000..9834c562471 --- /dev/null +++ b/man/get.vertex.attribute.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{get.vertex.attribute} +\alias{get.vertex.attribute} +\title{Query vertex attributes of a graph} +\usage{ +get.vertex.attribute(graph, name, index = V(graph)) +} +\arguments{ +\item{graph}{The graph.} + +\item{name}{Name of the attribute to query. If missing, then +all vertex attributes are returned in a list.} + +\item{index}{An optional vertex sequence to query the attribute only +for these vertices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.vertex.attribute()} was renamed to \code{vertex_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_attr.Rd b/man/graph_attr.Rd index 24da90ff989..886f71ef11d 100644 --- a/man/graph_attr.Rd +++ b/man/graph_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{graph_attr} \alias{graph_attr} -\alias{get.graph.attribute} \alias{graph.attributes} \title{Graph attributes of a graph} \usage{ diff --git a/man/graph_attr_names.Rd b/man/graph_attr_names.Rd index 8a91c0b3b11..d808548ead2 100644 --- a/man/graph_attr_names.Rd +++ b/man/graph_attr_names.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{graph_attr_names} \alias{graph_attr_names} -\alias{list.graph.attributes} \alias{attributes} \title{List names of graph attributes} \usage{ diff --git a/man/is.bipartite.Rd b/man/is.bipartite.Rd new file mode 100644 index 00000000000..ab0257badc7 --- /dev/null +++ b/man/is.bipartite.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{is.bipartite} +\alias{is.bipartite} +\title{Create a bipartite graph} +\usage{ +is.bipartite(graph) +} +\arguments{ +\item{graph}{The input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.bipartite()} was renamed to \code{is_bipartite()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.named.Rd b/man/is.named.Rd new file mode 100644 index 00000000000..f46cbcac029 --- /dev/null +++ b/man/is.named.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{is.named} +\alias{is.named} +\title{Named graphs} +\usage{ +is.named(graph) +} +\arguments{ +\item{graph}{The input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.named()} was renamed to \code{is_named()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.weighted.Rd b/man/is.weighted.Rd new file mode 100644 index 00000000000..28099ed6ce2 --- /dev/null +++ b/man/is.weighted.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{is.weighted} +\alias{is.weighted} +\title{Weighted graphs} +\usage{ +is.weighted(graph) +} +\arguments{ +\item{graph}{The input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.weighted()} was renamed to \code{is_weighted()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_named.Rd b/man/is_named.Rd index 07096304a3b..1b409257b93 100644 --- a/man/is_named.Rd +++ b/man/is_named.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{is_named} \alias{is_named} -\alias{is.named} \title{Named graphs} \usage{ is_named(graph) diff --git a/man/is_weighted.Rd b/man/is_weighted.Rd index 7c93881b58a..3f35b29936f 100644 --- a/man/is_weighted.Rd +++ b/man/is_weighted.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{is_weighted} \alias{is_weighted} -\alias{is.weighted} \title{Weighted graphs} \usage{ is_weighted(graph) diff --git a/man/list.edge.attributes.Rd b/man/list.edge.attributes.Rd new file mode 100644 index 00000000000..7f34f592035 --- /dev/null +++ b/man/list.edge.attributes.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{list.edge.attributes} +\alias{list.edge.attributes} +\title{List names of edge attributes} +\usage{ +list.edge.attributes(graph) +} +\arguments{ +\item{graph}{The graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{list.edge.attributes()} was renamed to \code{edge_attr_names()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/list.graph.attributes.Rd b/man/list.graph.attributes.Rd new file mode 100644 index 00000000000..4ed78a65925 --- /dev/null +++ b/man/list.graph.attributes.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{list.graph.attributes} +\alias{list.graph.attributes} +\title{List names of graph attributes} +\usage{ +list.graph.attributes(graph) +} +\arguments{ +\item{graph}{The graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{list.graph.attributes()} was renamed to \code{graph_attr_names()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/list.vertex.attributes.Rd b/man/list.vertex.attributes.Rd new file mode 100644 index 00000000000..f30d3bb0493 --- /dev/null +++ b/man/list.vertex.attributes.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{list.vertex.attributes} +\alias{list.vertex.attributes} +\title{List names of vertex attributes} +\usage{ +list.vertex.attributes(graph) +} +\arguments{ +\item{graph}{The graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{list.vertex.attributes()} was renamed to \code{vertex_attr_names()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/remove.edge.attribute.Rd b/man/remove.edge.attribute.Rd new file mode 100644 index 00000000000..4f389a40df3 --- /dev/null +++ b/man/remove.edge.attribute.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{remove.edge.attribute} +\alias{remove.edge.attribute} +\title{Delete an edge attribute} +\usage{ +remove.edge.attribute(graph, name) +} +\arguments{ +\item{graph}{The graph} + +\item{name}{The name of the edge attribute to delete.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{remove.edge.attribute()} was renamed to \code{delete_edge_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/remove.graph.attribute.Rd b/man/remove.graph.attribute.Rd new file mode 100644 index 00000000000..3dda70b6f4f --- /dev/null +++ b/man/remove.graph.attribute.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{remove.graph.attribute} +\alias{remove.graph.attribute} +\title{Delete a graph attribute} +\usage{ +remove.graph.attribute(graph, name) +} +\arguments{ +\item{graph}{The graph.} + +\item{name}{Name of the attribute to delete.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{remove.graph.attribute()} was renamed to \code{delete_graph_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/remove.vertex.attribute.Rd b/man/remove.vertex.attribute.Rd new file mode 100644 index 00000000000..c59c10d9489 --- /dev/null +++ b/man/remove.vertex.attribute.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{remove.vertex.attribute} +\alias{remove.vertex.attribute} +\title{Delete a vertex attribute} +\usage{ +remove.vertex.attribute(graph, name) +} +\arguments{ +\item{graph}{The graph} + +\item{name}{The name of the vertex attribute to delete.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{remove.vertex.attribute()} was renamed to \code{delete_vertex_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/set.edge.attribute.Rd b/man/set.edge.attribute.Rd new file mode 100644 index 00000000000..eb72afa0059 --- /dev/null +++ b/man/set.edge.attribute.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{set.edge.attribute} +\alias{set.edge.attribute} +\title{Set edge attributes} +\usage{ +set.edge.attribute(graph, name, index = E(graph), value) +} +\arguments{ +\item{graph}{The graph} + +\item{name}{The name of the attribute to set.} + +\item{index}{An optional edge sequence to set the attributes of +a subset of edges.} + +\item{value}{The new value of the attribute for all (or \code{index}) +edges. +If \code{NULL}, the input is returned unchanged.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{set.edge.attribute()} was renamed to \code{set_edge_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/set.graph.attribute.Rd b/man/set.graph.attribute.Rd new file mode 100644 index 00000000000..8493701bf4e --- /dev/null +++ b/man/set.graph.attribute.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{set.graph.attribute} +\alias{set.graph.attribute} +\title{Set a graph attribute} +\usage{ +set.graph.attribute(graph, name, value) +} +\arguments{ +\item{graph}{The graph.} + +\item{name}{The name of the attribute to set.} + +\item{value}{New value of the attribute.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{set.graph.attribute()} was renamed to \code{set_graph_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/set.vertex.attribute.Rd b/man/set.vertex.attribute.Rd new file mode 100644 index 00000000000..ecbac313735 --- /dev/null +++ b/man/set.vertex.attribute.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/attributes.R +\name{set.vertex.attribute} +\alias{set.vertex.attribute} +\title{Set vertex attributes} +\usage{ +set.vertex.attribute(graph, name, index = V(graph), value) +} +\arguments{ +\item{graph}{The graph.} + +\item{name}{The name of the attribute to set.} + +\item{index}{An optional vertex sequence to set the attributes +of a subset of vertices.} + +\item{value}{The new value of the attribute for all (or \code{index}) +vertices. +If \code{NULL}, the input is returned unchanged.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{set.vertex.attribute()} was renamed to \code{set_vertex_attr()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/set_edge_attr.Rd b/man/set_edge_attr.Rd index d188cdc00bb..07e3552f444 100644 --- a/man/set_edge_attr.Rd +++ b/man/set_edge_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{set_edge_attr} \alias{set_edge_attr} -\alias{set.edge.attribute} \title{Set edge attributes} \usage{ set_edge_attr(graph, name, index = E(graph), value) diff --git a/man/set_graph_attr.Rd b/man/set_graph_attr.Rd index 0675b573428..ab4d01bea15 100644 --- a/man/set_graph_attr.Rd +++ b/man/set_graph_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{set_graph_attr} \alias{set_graph_attr} -\alias{set.graph.attribute} \title{Set a graph attribute} \usage{ set_graph_attr(graph, name, value) diff --git a/man/set_vertex_attr.Rd b/man/set_vertex_attr.Rd index 3c0ef7f9fd9..734c03d3bbf 100644 --- a/man/set_vertex_attr.Rd +++ b/man/set_vertex_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{set_vertex_attr} \alias{set_vertex_attr} -\alias{set.vertex.attribute} \title{Set vertex attributes} \usage{ set_vertex_attr(graph, name, index = V(graph), value) diff --git a/man/vertex_attr.Rd b/man/vertex_attr.Rd index 04b04357df4..7c479865fde 100644 --- a/man/vertex_attr.Rd +++ b/man/vertex_attr.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{vertex_attr} \alias{vertex_attr} -\alias{get.vertex.attribute} \alias{vertex.attributes} \title{Query vertex attributes of a graph} \usage{ diff --git a/man/vertex_attr_names.Rd b/man/vertex_attr_names.Rd index d62dcfd92e2..52baa61942a 100644 --- a/man/vertex_attr_names.Rd +++ b/man/vertex_attr_names.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/attributes.R \name{vertex_attr_names} \alias{vertex_attr_names} -\alias{list.vertex.attributes} \title{List names of vertex attributes} \usage{ vertex_attr_names(graph) From 0242a3b29a34796158308253530bd96b889ffca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:53:00 +0100 Subject: [PATCH 07/48] refactor!: change R/basic.R --- R/basic.R | 17 +++++++++++++++-- man/is.igraph.Rd | 18 ++++++++++++++++++ man/is_igraph.Rd | 1 - 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 man/is.igraph.Rd diff --git a/R/basic.R b/R/basic.R index 290bf062b0a..a04197d6a76 100644 --- a/R/basic.R +++ b/R/basic.R @@ -1,3 +1,18 @@ + +#' Is this object an igraph graph? +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.igraph()` was renamed to `is_igraph()` to create a more +#' consistent API. +#' @inheritParams is_igraph +#' @keywords internal +#' @export +is.igraph <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.igraph()", "is_igraph()") + is_igraph(graph = graph) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -23,7 +38,6 @@ #' Is this object an igraph graph? #' -#' @aliases is.igraph #' @param graph An R object. #' @return A logical constant, `TRUE` if argument `graph` is a graph #' object. @@ -100,4 +114,3 @@ tail_of <- function(graph, es) { create_vs(graph, ends(graph, es, names = FALSE)[, 1]) } #' @export is.igraph -deprecated("is.igraph", is_igraph) diff --git a/man/is.igraph.Rd b/man/is.igraph.Rd new file mode 100644 index 00000000000..53d26bbb24d --- /dev/null +++ b/man/is.igraph.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/basic.R +\name{is.igraph} +\alias{is.igraph} +\title{Is this object an igraph graph?} +\usage{ +is.igraph(graph) +} +\arguments{ +\item{graph}{An R object.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.igraph()} was renamed to \code{is_igraph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_igraph.Rd b/man/is_igraph.Rd index a606e212907..798a29ab267 100644 --- a/man/is_igraph.Rd +++ b/man/is_igraph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/basic.R \name{is_igraph} \alias{is_igraph} -\alias{is.igraph} \title{Is this object an igraph graph?} \usage{ is_igraph(graph) From 94039a82468e765ede93828a399531d1c1ffe3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:53:29 +0100 Subject: [PATCH 08/48] refactor!: change R/bipartite.R --- R/bipartite.R | 52 +++++++++++++++++++++++++++----- man/bipartite.mapping.Rd | 18 +++++++++++ man/bipartite.projection.Rd | 51 +++++++++++++++++++++++++++++++ man/bipartite.projection.size.Rd | 23 ++++++++++++++ man/bipartite_mapping.Rd | 1 - man/bipartite_projection.Rd | 2 -- 6 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 man/bipartite.mapping.Rd create mode 100644 man/bipartite.projection.Rd create mode 100644 man/bipartite.projection.size.Rd diff --git a/R/bipartite.R b/R/bipartite.R index 9cc2bbbff7a..0708b288cb1 100644 --- a/R/bipartite.R +++ b/R/bipartite.R @@ -1,3 +1,48 @@ + +#' Project a bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `bipartite.projection.size()` was renamed to `bipartite_projection_size()` to create a more +#' consistent API. +#' @inheritParams bipartite_projection_size +#' @keywords internal +#' @export +bipartite.projection.size <- function(graph , types = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "bipartite.projection.size()", "bipartite_projection_size()") + bipartite_projection_size(graph = graph, types = types) +} # nocov end + +#' Project a bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `bipartite.projection()` was renamed to `bipartite_projection()` to create a more +#' consistent API. +#' @inheritParams bipartite_projection +#' @keywords internal +#' @export +bipartite.projection <- function(graph , types = NULL , multiplicity = TRUE , probe1 = NULL , which = c("both","true","false") , remove.type = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "bipartite.projection()", "bipartite_projection()") + bipartite_projection(graph = graph, types = types, multiplicity = multiplicity, probe1 = probe1, which = which, remove.type = remove.type) +} # nocov end + +#' Decide whether a graph is bipartite +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `bipartite.mapping()` was renamed to `bipartite_mapping()` to create a more +#' consistent API. +#' @inheritParams bipartite_mapping +#' @keywords internal +#' @export +bipartite.mapping <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "bipartite.mapping()", "bipartite_mapping()") + bipartite_mapping(graph = graph) +} # nocov end # IGraph R package # Copyright (C) 2009-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -41,7 +86,6 @@ #' #' `bipartite_projection()` keeps vertex attributes. #' -#' @aliases bipartite.projection bipartite.projection.size #' @param graph The input graph. It can be directed, but edge directions are #' ignored during the computation. #' @param types An optional vertex type vector to use instead of the @@ -170,7 +214,6 @@ bipartite_projection_size <- bipartite_projection_size_impl #' least two components, then the vertices in the separate components can be #' mapped independently. #' -#' @aliases bipartite.mapping #' @param graph The input graph. #' @return A named list with two elements: \item{res}{A logical scalar, #' `TRUE` if the can be bipartite, `FALSE` otherwise.} \item{type}{A @@ -196,8 +239,3 @@ bipartite_projection_size <- bipartite_projection_size_impl #' @export bipartite_mapping <- is_bipartite_impl #' @export bipartite.mapping -deprecated("bipartite.mapping", bipartite_mapping) -#' @export bipartite.projection -deprecated("bipartite.projection", bipartite_projection) -#' @export bipartite.projection.size -deprecated("bipartite.projection.size", bipartite_projection_size) diff --git a/man/bipartite.mapping.Rd b/man/bipartite.mapping.Rd new file mode 100644 index 00000000000..0253b5bba72 --- /dev/null +++ b/man/bipartite.mapping.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartite.R +\name{bipartite.mapping} +\alias{bipartite.mapping} +\title{Decide whether a graph is bipartite} +\usage{ +bipartite.mapping(graph) +} +\arguments{ +\item{graph}{The input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{bipartite.mapping()} was renamed to \code{bipartite_mapping()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/bipartite.projection.Rd b/man/bipartite.projection.Rd new file mode 100644 index 00000000000..7c2765c62d0 --- /dev/null +++ b/man/bipartite.projection.Rd @@ -0,0 +1,51 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartite.R +\name{bipartite.projection} +\alias{bipartite.projection} +\title{Project a bipartite graph} +\usage{ +bipartite.projection( + graph, + types = NULL, + multiplicity = TRUE, + probe1 = NULL, + which = c("both", "true", "false"), + remove.type = TRUE +) +} +\arguments{ +\item{graph}{The input graph. It can be directed, but edge directions are +ignored during the computation.} + +\item{types}{An optional vertex type vector to use instead of the +\sQuote{\code{type}} vertex attribute. You must supply this argument if the +graph has no \sQuote{\code{type}} vertex attribute.} + +\item{multiplicity}{If \code{TRUE}, then igraph keeps the multiplicity of +the edges as an edge attribute called \sQuote{weight}. +E.g. if there is an A-C-B and also an A-D-B +triple in the bipartite graph (but no more X, such that A-X-B is also in the +graph), then the multiplicity of the A-B edge in the projection will be 2.} + +\item{probe1}{This argument can be used to specify the order of the +projections in the resulting list. If given, then it is considered as a +vertex id (or a symbolic vertex name); the projection containing this vertex +will be the first one in the result list. This argument is ignored if only +one projection is requested in argument \code{which}.} + +\item{which}{A character scalar to specify which projection(s) to calculate. +The default is to calculate both.} + +\item{remove.type}{Logical scalar, whether to remove the \code{type} vertex +attribute from the projections. This makes sense because these graphs are +not bipartite any more. However if you want to combine them with each other +(or other bipartite graphs), then it is worth keeping this attribute. By +default it will be removed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{bipartite.projection()} was renamed to \code{bipartite_projection()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/bipartite.projection.size.Rd b/man/bipartite.projection.size.Rd new file mode 100644 index 00000000000..0647a00cb3d --- /dev/null +++ b/man/bipartite.projection.size.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/bipartite.R +\name{bipartite.projection.size} +\alias{bipartite.projection.size} +\title{Project a bipartite graph} +\usage{ +bipartite.projection.size(graph, types = NULL) +} +\arguments{ +\item{graph}{The input graph. It can be directed, but edge directions are +ignored during the computation.} + +\item{types}{An optional vertex type vector to use instead of the +\sQuote{\code{type}} vertex attribute. You must supply this argument if the +graph has no \sQuote{\code{type}} vertex attribute.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{bipartite.projection.size()} was renamed to \code{bipartite_projection_size()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/bipartite_mapping.Rd b/man/bipartite_mapping.Rd index d5a3f0c599f..72e621f82bc 100644 --- a/man/bipartite_mapping.Rd +++ b/man/bipartite_mapping.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/bipartite.R \name{bipartite_mapping} \alias{bipartite_mapping} -\alias{bipartite.mapping} \title{Decide whether a graph is bipartite} \usage{ bipartite_mapping(graph) diff --git a/man/bipartite_projection.Rd b/man/bipartite_projection.Rd index 4e90535cef1..a49713feac4 100644 --- a/man/bipartite_projection.Rd +++ b/man/bipartite_projection.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/bipartite.R \name{bipartite_projection} \alias{bipartite_projection} -\alias{bipartite.projection} -\alias{bipartite.projection.size} \alias{bipartite_projection_size} \title{Project a bipartite graph} \usage{ From 3d56fb54f7644082c24bc76c98415be931c83462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:54:00 +0100 Subject: [PATCH 09/48] refactor!: change R/centrality.R --- R/centrality.R | 203 ++++++++++++++++++++++++++++++------- man/alpha.centrality.Rd | 57 +++++++++++ man/alpha_centrality.Rd | 1 - man/authority.score.Rd | 37 +++++++ man/betweenness.Rd | 1 - man/bonpow.Rd | 46 +++++++++ man/diversity.Rd | 1 - man/edge.betweenness.Rd | 37 +++++++ man/eigen_centrality.Rd | 1 - man/evcent.Rd | 46 +++++++++ man/graph.diversity.Rd | 24 +++++ man/graph.eigen.Rd | 33 ++++++ man/graph.strength.Rd | 38 +++++++ man/hub.score.Rd | 32 ++++++ man/hub_score.Rd | 2 - man/page.rank.Rd | 63 ++++++++++++ man/page_rank.Rd | 1 - man/power_centrality.Rd | 1 - man/spectrum.Rd | 1 - man/strength.Rd | 1 - man/subgraph.centrality.Rd | 23 +++++ man/subgraph_centrality.Rd | 1 - 22 files changed, 605 insertions(+), 45 deletions(-) create mode 100644 man/alpha.centrality.Rd create mode 100644 man/authority.score.Rd create mode 100644 man/bonpow.Rd create mode 100644 man/edge.betweenness.Rd create mode 100644 man/evcent.Rd create mode 100644 man/graph.diversity.Rd create mode 100644 man/graph.eigen.Rd create mode 100644 man/graph.strength.Rd create mode 100644 man/hub.score.Rd create mode 100644 man/page.rank.Rd create mode 100644 man/subgraph.centrality.Rd diff --git a/R/centrality.R b/R/centrality.R index 6399281643c..4407beb79dd 100644 --- a/R/centrality.R +++ b/R/centrality.R @@ -1,3 +1,168 @@ + +#' Find subgraph centrality scores of network positions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `subgraph.centrality()` was renamed to `subgraph_centrality()` to create a more +#' consistent API. +#' @inheritParams subgraph_centrality +#' @keywords internal +#' @export +subgraph.centrality <- function(graph , diag = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "subgraph.centrality()", "subgraph_centrality()") + subgraph_centrality(graph = graph, diag = diag) +} # nocov end + +#' The Page Rank algorithm +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `page.rank()` was renamed to `page_rank()` to create a more +#' consistent API. +#' @inheritParams page_rank +#' @keywords internal +#' @export +page.rank <- function(graph , algo = c("prpack","arpack") , vids = V(graph) , directed = TRUE , damping = 0.85 , personalized = NULL , weights = NULL , options = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "page.rank()", "page_rank()") + page_rank(graph = graph, algo = algo, vids = vids, directed = directed, damping = damping, personalized = personalized, weights = weights, options = options) +} # nocov end + +#' Kleinberg's hub and authority centrality scores. +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hub.score()` was renamed to `hub_score()` to create a more +#' consistent API. +#' @inheritParams hub_score +#' @keywords internal +#' @export +hub.score <- function(graph , scale = TRUE , weights = NULL , options = arpack_defaults()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hub.score()", "hub_score()") + hub_score(graph = graph, scale = scale, weights = weights, options = options) +} # nocov end + +#' Strength or weighted vertex degree +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.strength()` was renamed to `strength()` to create a more +#' consistent API. +#' @inheritParams strength +#' @keywords internal +#' @export +graph.strength <- function(graph , vids = V(graph) , mode = c("all","out","in","total") , loops = TRUE , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.strength()", "strength()") + strength(graph = graph, vids = vids, mode = mode, loops = loops, weights = weights) +} # nocov end + +#' Eigenvalues and eigenvectors of the adjacency matrix of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.eigen()` was renamed to `spectrum()` to create a more +#' consistent API. +#' @inheritParams spectrum +#' @keywords internal +#' @export +graph.eigen <- function(graph , algorithm = c("arpack","auto","lapack","comp_auto","comp_lapack","comp_arpack") , which = list() , options = arpack_defaults()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.eigen()", "spectrum()") + spectrum(graph = graph, algorithm = algorithm, which = which, options = options) +} # nocov end + +#' Graph diversity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.diversity()` was renamed to `diversity()` to create a more +#' consistent API. +#' @inheritParams diversity +#' @keywords internal +#' @export +graph.diversity <- function(graph , weights = NULL , vids = V(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.diversity()", "diversity()") + diversity(graph = graph, weights = weights, vids = vids) +} # nocov end + +#' Find Eigenvector Centrality Scores of Network Positions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `evcent()` was renamed to `eigen_centrality()` to create a more +#' consistent API. +#' @inheritParams eigen_centrality +#' @keywords internal +#' @export +evcent <- function(graph , directed = FALSE , scale = TRUE , weights = NULL , options = arpack_defaults()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "evcent()", "eigen_centrality()") + eigen_centrality(graph = graph, directed = directed, scale = scale, weights = weights, options = options) +} # nocov end + +#' Vertex and edge betweenness centrality +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `edge.betweenness()` was renamed to `edge_betweenness()` to create a more +#' consistent API. +#' @inheritParams edge_betweenness +#' @keywords internal +#' @export +edge.betweenness <- function(graph , e = E(graph) , directed = TRUE , weights = NULL , cutoff = -1) { # nocov start + lifecycle::deprecate_soft("1.6.0", "edge.betweenness()", "edge_betweenness()") + edge_betweenness(graph = graph, e = e, directed = directed, weights = weights, cutoff = cutoff) +} # nocov end + +#' Find Bonacich Power Centrality Scores of Network Positions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `bonpow()` was renamed to `power_centrality()` to create a more +#' consistent API. +#' @inheritParams power_centrality +#' @keywords internal +#' @export +bonpow <- function(graph , nodes = V(graph) , loops = FALSE , exponent = 1 , rescale = FALSE , tol = 1e-7 , sparse = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "bonpow()", "power_centrality()") + power_centrality(graph = graph, nodes = nodes, loops = loops, exponent = exponent, rescale = rescale, tol = tol, sparse = sparse) +} # nocov end + +#' Kleinberg's hub and authority centrality scores. +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `authority.score()` was renamed to `authority_score()` to create a more +#' consistent API. +#' @inheritParams authority_score +#' @keywords internal +#' @export +authority.score <- function(graph , scale = TRUE , weights = NULL , options = arpack_defaults()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "authority.score()", "authority_score()") + authority_score(graph = graph, scale = scale, weights = weights, options = options) +} # nocov end + +#' Find Bonacich alpha centrality scores of network positions +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `alpha.centrality()` was renamed to `alpha_centrality()` to create a more +#' consistent API. +#' @inheritParams alpha_centrality +#' @keywords internal +#' @export +alpha.centrality <- function(graph , nodes = V(graph) , alpha = 1 , loops = FALSE , exo = 1 , weights = NULL , tol = 1e-7 , sparse = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "alpha.centrality()", "alpha_centrality()") + alpha_centrality(graph = graph, nodes = nodes, alpha = alpha, loops = loops, exo = exo, weights = weights, tol = tol, sparse = sparse) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -74,8 +239,8 @@ betweenness.estimate <- estimate_betweenness #' For calculating the betweenness a similar algorithm to the one proposed by #' Brandes (see References) is used. #' -#' @aliases edge.betweenness betweenness.estimate -#' edge.betweenness.estimate edge_betweenness +#' @aliases betweenness.estimate +#' @aliases edge.betweenness.estimate #' @param graph The graph to analyze. #' @param v The vertices for which the vertex betweenness will be calculated. #' @param directed Logical, whether directed paths should be considered while @@ -432,7 +597,7 @@ arpack_defaults <- function() { #' additional details. #' #' @aliases arpack arpack-options arpack.unpack.complex -#' arpack_defaults +#' @aliases arpack_defaults #' @param func The function to perform the matrix-vector multiplication. ARPACK #' requires to perform these by the user. The function gets the vector \eqn{x} #' as the first argument, and it should return \eqn{Ax}, where \eqn{A} is the @@ -607,7 +772,6 @@ arpack.unpack.complex <- function(vectors, values, nev) { #' eigenvalues and eigenvectors of the adjacency matrix of the graph. This #' effectively means that the measure can only be calculated for small graphs. #' -#' @aliases subgraph.centrality #' @param graph The input graph, it should be undirected, but the #' implementation does not check this currently. #' @param diag Boolean scalar, whether to include the diagonal of the adjacency @@ -667,7 +831,7 @@ subgraph_centrality <- function(graph, diag = FALSE) { #' Note that ARPACK might be unstable for graphs with multiple components, e.g. #' graphs with isolate vertices. #' -#' @aliases graph.eigen spectrum igraph.eigen.default +#' @aliases spectrum igraph.eigen.default #' @param graph The input graph, can be directed or undirected. #' @param algorithm The algorithm to use. Currently only `arpack` is #' implemented, which uses the ARPACK solver. See also [arpack()]. @@ -772,7 +936,6 @@ eigen_defaults <- function() { #' From igraph version 0.5 this function uses ARPACK for the underlying #' computation, see [arpack()] for more about ARPACK in igraph. #' -#' @aliases evcent #' @param graph Graph to be analyzed. #' @param directed Logical scalar, whether to consider direction of the edges #' in directed graphs. It is ignored for undirected graphs. @@ -838,7 +1001,6 @@ eigen_centrality <- function(graph, #' Summing up the edge weights of the adjacent edges for each vertex. #' #' -#' @aliases graph.strength #' @param graph The input graph. #' @param vids The vertices for which the strength will be calculated. #' @param mode Character string, \dQuote{out} for out-degree, \dQuote{in} for @@ -890,7 +1052,6 @@ strength <- strength_impl #' #' For vertices with degree less than two the function returns `NaN`. #' -#' @aliases graph.diversity #' @param graph The input graph. Edge directions are ignored. #' @param weights `NULL`, or the vector of edge weights to use for the #' computation. If `NULL`, then the \sQuote{weight} attibute is used. Note @@ -930,7 +1091,6 @@ diversity <- diversity_impl #' For undirected matrices the adjacency matrix is symmetric and the hub #' scores are the same as authority scores. #' -#' @aliases hub.score #' @param graph The input graph. #' @param scale Logical scalar, whether to scale the result to have a maximum #' score of one. If no scaling is used then the result vector has unit length @@ -988,7 +1148,6 @@ hub_score <- function(graph, scale=TRUE, weights=NULL, options=arpack_defaults() } #' @rdname hub_score -#' @aliases authority.score #' @param options A named list, to override some ARPACK options. See #' [arpack()] for details. #' @export @@ -1030,7 +1189,6 @@ authority_score <- function(graph, scale=TRUE, weights=NULL, options=arpack_defa #' PageRank for only some of the vertices does not result in any performance #' increase at all. #' -#' @aliases page.rank #' @param graph The graph object. #' @param algo Character scalar, which implementation to use to carry out the #' calculation. The default is `"prpack"`, which uses the PRPACK library @@ -1240,7 +1398,6 @@ bonpow.sparse <- function(graph, nodes = V(graph), loops = FALSE, #' theory motivates use of this measure, you should be very careful to choose a #' decay parameter on a non-ad hoc basis. #' -#' @aliases bonpow #' @param graph the input graph. #' @param nodes vertex sequence indicating which vertices are to be included in #' the calculation. By default, all vertices are included. @@ -1420,7 +1577,6 @@ alpha.centrality.sparse <- function(graph, nodes = V(graph), alpha = 1, #' vertices and \eqn{\alpha}{alpha} is the relative importance of the #' endogenous versus exogenous factors. #' -#' @aliases alpha.centrality #' @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 @@ -1488,24 +1644,3 @@ alpha_centrality <- function(graph, nodes = V(graph), alpha = 1, res } #' @export alpha.centrality -deprecated("alpha.centrality", alpha_centrality) -#' @export authority.score -deprecated("authority.score", authority_score) -#' @export bonpow -deprecated("bonpow", power_centrality) -#' @export edge.betweenness -deprecated("edge.betweenness", edge_betweenness) -#' @export evcent -deprecated("evcent", eigen_centrality) -#' @export graph.diversity -deprecated("graph.diversity", diversity) -#' @export graph.eigen -deprecated("graph.eigen", spectrum) -#' @export graph.strength -deprecated("graph.strength", strength) -#' @export hub.score -deprecated("hub.score", hub_score) -#' @export page.rank -deprecated("page.rank", page_rank) -#' @export subgraph.centrality -deprecated("subgraph.centrality", subgraph_centrality) diff --git a/man/alpha.centrality.Rd b/man/alpha.centrality.Rd new file mode 100644 index 00000000000..375e748d431 --- /dev/null +++ b/man/alpha.centrality.Rd @@ -0,0 +1,57 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{alpha.centrality} +\alias{alpha.centrality} +\title{Find Bonacich alpha centrality scores of network positions} +\usage{ +alpha.centrality( + graph, + nodes = V(graph), + alpha = 1, + loops = FALSE, + exo = 1, + weights = NULL, + tol = 1e-07, + sparse = TRUE +) +} +\arguments{ +\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.} + +\item{loops}{Whether to eliminate loop edges from the graph before the +calculation.} + +\item{exo}{The exogenous factors, in most cases this is either a constant -- +the same factor for every node, or a vector giving the factor for every +vertex. Note that too long vectors will be truncated and too short vectors +will be replicated to match the number of vertices.} + +\item{weights}{A character scalar that gives the name of the edge attribute +to use in the adjacency matrix. If it is \code{NULL}, then the +\sQuote{weight} edge attribute of the graph is used, if there is one. +Otherwise, or if it is \code{NA}, then the calculation uses the standard +adjacency matrix.} + +\item{tol}{Tolerance for near-singularities during matrix inversion, see +\code{\link[=solve]{solve()}}.} + +\item{sparse}{Logical scalar, whether to use sparse matrices for the +calculation. The \sQuote{Matrix} package is required for sparse matrix +support} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{alpha.centrality()} was renamed to \code{alpha_centrality()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/alpha_centrality.Rd b/man/alpha_centrality.Rd index 0a168b76f19..bc066585433 100644 --- a/man/alpha_centrality.Rd +++ b/man/alpha_centrality.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{alpha_centrality} \alias{alpha_centrality} -\alias{alpha.centrality} \title{Find Bonacich alpha centrality scores of network positions} \usage{ alpha_centrality( diff --git a/man/authority.score.Rd b/man/authority.score.Rd new file mode 100644 index 00000000000..bfbb0345b96 --- /dev/null +++ b/man/authority.score.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{authority.score} +\alias{authority.score} +\title{Kleinberg's hub and authority centrality scores.} +\usage{ +authority.score( + graph, + scale = TRUE, + weights = NULL, + options = arpack_defaults() +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{scale}{Logical scalar, whether to scale the result to have a maximum +score of one. If no scaling is used then the result vector has unit length +in the Euclidean norm.} + +\item{weights}{Optional positive weight vector for calculating weighted +scores. If the graph has a \code{weight} edge attribute, then this is used +by default. +This function interprets edge weights as connection strengths. In the +random surfer model, an edge with a larger weight is more likely to be +selected by the surfer.} + +\item{options}{A named list, to override some ARPACK options. See +\code{\link[=arpack]{arpack()}} for details.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{authority.score()} was renamed to \code{authority_score()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/betweenness.Rd b/man/betweenness.Rd index 68e52b54dc5..b9145c8fb26 100644 --- a/man/betweenness.Rd +++ b/man/betweenness.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{betweenness} \alias{betweenness} -\alias{edge.betweenness} \alias{betweenness.estimate} \alias{edge.betweenness.estimate} \alias{edge_betweenness} diff --git a/man/bonpow.Rd b/man/bonpow.Rd new file mode 100644 index 00000000000..97a6598ca0f --- /dev/null +++ b/man/bonpow.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{bonpow} +\alias{bonpow} +\title{Find Bonacich Power Centrality Scores of Network Positions} +\usage{ +bonpow( + graph, + nodes = V(graph), + loops = FALSE, + exponent = 1, + rescale = FALSE, + tol = 1e-07, + sparse = TRUE +) +} +\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.} + +\item{exponent}{exponent (decay rate) for the Bonacich power centrality +score; can be negative} + +\item{rescale}{if true, centrality scores are rescaled such that they sum to +1.} + +\item{tol}{tolerance for near-singularities during matrix inversion (see +\code{\link[=solve]{solve()}})} + +\item{sparse}{Logical scalar, whether to use sparse matrices for the +calculation. The \sQuote{Matrix} package is required for sparse matrix +support} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{bonpow()} was renamed to \code{power_centrality()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/diversity.Rd b/man/diversity.Rd index 2e9b2731ddf..9051ee339e5 100644 --- a/man/diversity.Rd +++ b/man/diversity.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{diversity} \alias{diversity} -\alias{graph.diversity} \title{Graph diversity} \usage{ diversity(graph, weights = NULL, vids = V(graph)) diff --git a/man/edge.betweenness.Rd b/man/edge.betweenness.Rd new file mode 100644 index 00000000000..c7fd6f36f1b --- /dev/null +++ b/man/edge.betweenness.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{edge.betweenness} +\alias{edge.betweenness} +\title{Vertex and edge betweenness centrality} +\usage{ +edge.betweenness( + graph, + e = E(graph), + directed = TRUE, + weights = NULL, + cutoff = -1 +) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{e}{The edges for which the edge betweenness will be calculated.} + +\item{directed}{Logical, whether directed paths should be considered while +determining the shortest paths.} + +\item{weights}{Optional positive weight vector for calculating weighted +betweenness. If the graph has a \code{weight} edge attribute, then this is +used by default. Weights are used to calculate weighted shortest paths, +so they are interpreted as distances.} + +\item{cutoff}{The maximum path length to consider when calculating the +betweenness. If zero or negative then there is no such limit.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{edge.betweenness()} was renamed to \code{edge_betweenness()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/eigen_centrality.Rd b/man/eigen_centrality.Rd index ee4e8efa30b..b39234100ea 100644 --- a/man/eigen_centrality.Rd +++ b/man/eigen_centrality.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{eigen_centrality} \alias{eigen_centrality} -\alias{evcent} \title{Find Eigenvector Centrality Scores of Network Positions} \usage{ eigen_centrality( diff --git a/man/evcent.Rd b/man/evcent.Rd new file mode 100644 index 00000000000..1b5d2cb3371 --- /dev/null +++ b/man/evcent.Rd @@ -0,0 +1,46 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{evcent} +\alias{evcent} +\title{Find Eigenvector Centrality Scores of Network Positions} +\usage{ +evcent( + graph, + directed = FALSE, + scale = TRUE, + weights = NULL, + options = arpack_defaults() +) +} +\arguments{ +\item{graph}{Graph to be analyzed.} + +\item{directed}{Logical scalar, whether to consider direction of the edges +in directed graphs. It is ignored for undirected graphs.} + +\item{scale}{Logical scalar, whether to scale the result to have a maximum +score of one. If no scaling is used then the result vector has unit length +in the Euclidean norm.} + +\item{weights}{A numerical vector or \code{NULL}. This argument can be used +to give edge weights for calculating the weighted eigenvector centrality of +vertices. If this is \code{NULL} and the graph has a \code{weight} edge +attribute then that is used. If \code{weights} is a numerical vector then it is +used, even if the graph has a \code{weight} edge attribute. If this is +\code{NA}, then no edge weights are used (even if the graph has a +\code{weight} edge attribute). Note that if there are negative edge weights +and the direction of the edges is considered, then the eigenvector might be +complex. In this case only the real part is reported. +This function interprets weights as connection strength. Higher +weights spread the centrality better.} + +\item{options}{A named list, to override some ARPACK options. See +\code{\link[=arpack]{arpack()}} for details.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{evcent()} was renamed to \code{eigen_centrality()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.diversity.Rd b/man/graph.diversity.Rd new file mode 100644 index 00000000000..05b55d5ca83 --- /dev/null +++ b/man/graph.diversity.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{graph.diversity} +\alias{graph.diversity} +\title{Graph diversity} +\usage{ +graph.diversity(graph, weights = NULL, vids = V(graph)) +} +\arguments{ +\item{graph}{The input graph. Edge directions are ignored.} + +\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]}} + +\code{graph.diversity()} was renamed to \code{diversity()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.eigen.Rd b/man/graph.eigen.Rd new file mode 100644 index 00000000000..2a374fac921 --- /dev/null +++ b/man/graph.eigen.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{graph.eigen} +\alias{graph.eigen} +\title{Eigenvalues and eigenvectors of the adjacency matrix of a graph} +\usage{ +graph.eigen( + graph, + algorithm = c("arpack", "auto", "lapack", "comp_auto", "comp_lapack", "comp_arpack"), + which = list(), + options = arpack_defaults() +) +} +\arguments{ +\item{graph}{The input graph, can be directed or undirected.} + +\item{algorithm}{The algorithm to use. Currently only \code{arpack} is +implemented, which uses the ARPACK solver. See also \code{\link[=arpack]{arpack()}}.} + +\item{which}{A list to specify which eigenvalues and eigenvectors to +calculate. By default the leading (i.e. largest magnitude) eigenvalue and +the corresponding eigenvector is calculated.} + +\item{options}{Options for the ARPACK solver. See +\code{\link[=arpack_defaults]{arpack_defaults()}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.eigen()} was renamed to \code{spectrum()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.strength.Rd b/man/graph.strength.Rd new file mode 100644 index 00000000000..23ee3b847c1 --- /dev/null +++ b/man/graph.strength.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{graph.strength} +\alias{graph.strength} +\title{Strength or weighted vertex degree} +\usage{ +graph.strength( + graph, + vids = V(graph), + mode = c("all", "out", "in", "total"), + loops = TRUE, + weights = NULL +) +} +\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.} + +\item{loops}{Logical; whether the loop edges are also counted.} + +\item{weights}{Weight vector. If the graph has a \code{weight} edge +attribute, then this is used by default. If the graph does not have a +\code{weight} edge attribute and this argument is \code{NULL}, then a +\code{\link[=degree]{degree()}} is called. If this is \code{NA}, then no edge weights are used +(even if the graph has a \code{weight} edge attribute).} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.strength()} was renamed to \code{strength()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hub.score.Rd b/man/hub.score.Rd new file mode 100644 index 00000000000..53822e76652 --- /dev/null +++ b/man/hub.score.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{hub.score} +\alias{hub.score} +\title{Kleinberg's hub and authority centrality scores.} +\usage{ +hub.score(graph, scale = TRUE, weights = NULL, options = arpack_defaults()) +} +\arguments{ +\item{graph}{The input graph.} + +\item{scale}{Logical scalar, whether to scale the result to have a maximum +score of one. If no scaling is used then the result vector has unit length +in the Euclidean norm.} + +\item{weights}{Optional positive weight vector for calculating weighted +scores. If the graph has a \code{weight} edge attribute, then this is used +by default. +This function interprets edge weights as connection strengths. In the +random surfer model, an edge with a larger weight is more likely to be +selected by the surfer.} + +\item{options}{A named list, to override some ARPACK options. See +\code{\link[=arpack]{arpack()}} for details.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hub.score()} was renamed to \code{hub_score()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hub_score.Rd b/man/hub_score.Rd index 133c5d677ee..7e583312a74 100644 --- a/man/hub_score.Rd +++ b/man/hub_score.Rd @@ -2,9 +2,7 @@ % Please edit documentation in R/centrality.R \name{hub_score} \alias{hub_score} -\alias{hub.score} \alias{authority_score} -\alias{authority.score} \title{Kleinberg's hub and authority centrality scores.} \usage{ hub_score(graph, scale = TRUE, weights = NULL, options = arpack_defaults()) diff --git a/man/page.rank.Rd b/man/page.rank.Rd new file mode 100644 index 00000000000..6c57efa0a04 --- /dev/null +++ b/man/page.rank.Rd @@ -0,0 +1,63 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{page.rank} +\alias{page.rank} +\title{The Page Rank algorithm} +\usage{ +page.rank( + graph, + algo = c("prpack", "arpack"), + vids = V(graph), + directed = TRUE, + damping = 0.85, + personalized = NULL, + weights = NULL, + options = NULL +) +} +\arguments{ +\item{graph}{The graph object.} + +\item{algo}{Character scalar, which implementation to use to carry out the +calculation. The default is \code{"prpack"}, which uses the PRPACK library +(\url{https://github.com/dgleich/prpack}) to calculate PageRank scores +by solving a set of linear equations. This is a new implementation in igraph +version 0.7, and the suggested one, as it is the most stable and the fastest +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.} + +\item{damping}{The damping factor (\sQuote{d} in the original paper).} + +\item{personalized}{Optional vector giving a probability distribution to +calculate personalized PageRank. For personalized PageRank, the probability +of jumping to a node when abandoning the random walk is not uniform, but it +is given by this vector. The vector should contains an entry for each vertex +and it will be rescaled to sum up to one.} + +\item{weights}{A numerical vector or \code{NULL}. This argument can be used +to give edge weights for calculating the weighted PageRank of vertices. If +this is \code{NULL} and the graph has a \code{weight} edge attribute then +that is used. If \code{weights} is a numerical vector then it used, even if +the graph has a \code{weights} edge attribute. If this is \code{NA}, then no +edge weights are used (even if the graph has a \code{weight} edge attribute. +This function interprets edge weights as connection strengths. In the +random surfer model, an edge with a larger weight is more likely to be +selected by the surfer.} + +\item{options}{A named list, to override some ARPACK options. See +\code{\link[=arpack]{arpack()}} for details. This argument is ignored if the PRPACK +implementation is used.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{page.rank()} was renamed to \code{page_rank()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/page_rank.Rd b/man/page_rank.Rd index 81da26a1526..892dd73b099 100644 --- a/man/page_rank.Rd +++ b/man/page_rank.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{page_rank} \alias{page_rank} -\alias{page.rank} \title{The Page Rank algorithm} \usage{ page_rank( diff --git a/man/power_centrality.Rd b/man/power_centrality.Rd index 410a6129c02..e046e60d069 100644 --- a/man/power_centrality.Rd +++ b/man/power_centrality.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{power_centrality} \alias{power_centrality} -\alias{bonpow} \title{Find Bonacich Power Centrality Scores of Network Positions} \usage{ power_centrality( diff --git a/man/spectrum.Rd b/man/spectrum.Rd index 244c1324372..ac73ca76c67 100644 --- a/man/spectrum.Rd +++ b/man/spectrum.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{spectrum} \alias{spectrum} -\alias{graph.eigen} \alias{igraph.eigen.default} \title{Eigenvalues and eigenvectors of the adjacency matrix of a graph} \usage{ diff --git a/man/strength.Rd b/man/strength.Rd index 38d97b00ca1..ea853bb4b7f 100644 --- a/man/strength.Rd +++ b/man/strength.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{strength} \alias{strength} -\alias{graph.strength} \title{Strength or weighted vertex degree} \usage{ strength( diff --git a/man/subgraph.centrality.Rd b/man/subgraph.centrality.Rd new file mode 100644 index 00000000000..f685b21612d --- /dev/null +++ b/man/subgraph.centrality.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centrality.R +\name{subgraph.centrality} +\alias{subgraph.centrality} +\title{Find subgraph centrality scores of network positions} +\usage{ +subgraph.centrality(graph, diag = FALSE) +} +\arguments{ +\item{graph}{The input graph, it should be undirected, but the +implementation does not check this currently.} + +\item{diag}{Boolean scalar, whether to include the diagonal of the adjacency +matrix in the analysis. Giving \code{FALSE} here effectively eliminates the +loops edges from the graph before the calculation.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{subgraph.centrality()} was renamed to \code{subgraph_centrality()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/subgraph_centrality.Rd b/man/subgraph_centrality.Rd index ff9fe09634f..878fa20201e 100644 --- a/man/subgraph_centrality.Rd +++ b/man/subgraph_centrality.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centrality.R \name{subgraph_centrality} \alias{subgraph_centrality} -\alias{subgraph.centrality} \title{Find subgraph centrality scores of network positions} \usage{ subgraph_centrality(graph, diag = FALSE) From 2406eab9de321a947c9ddc76ea0005b2d0239abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:54:30 +0100 Subject: [PATCH 10/48] refactor!: change R/centralization.R --- R/centralization.R | 162 +++++++++++++++++++++---- man/centr_betw.Rd | 1 - man/centr_betw_tmax.Rd | 1 - man/centr_clo.Rd | 1 - man/centr_clo_tmax.Rd | 1 - man/centr_degree.Rd | 1 - man/centr_degree_tmax.Rd | 1 - man/centr_eigen.Rd | 1 - man/centr_eigen_tmax.Rd | 1 - man/centralization.betweenness.Rd | 24 ++++ man/centralization.betweenness.tmax.Rd | 25 ++++ man/centralization.closeness.Rd | 28 +++++ man/centralization.closeness.tmax.Rd | 29 +++++ man/centralization.degree.Rd | 32 +++++ man/centralization.degree.tmax.Rd | 33 +++++ man/centralization.evcent.Rd | 36 ++++++ man/centralization.evcent.tmax.Rd | 33 +++++ man/centralize.Rd | 1 - man/centralize.scores.Rd | 26 ++++ 19 files changed, 402 insertions(+), 35 deletions(-) create mode 100644 man/centralization.betweenness.Rd create mode 100644 man/centralization.betweenness.tmax.Rd create mode 100644 man/centralization.closeness.Rd create mode 100644 man/centralization.closeness.tmax.Rd create mode 100644 man/centralization.degree.Rd create mode 100644 man/centralization.degree.tmax.Rd create mode 100644 man/centralization.evcent.Rd create mode 100644 man/centralization.evcent.tmax.Rd create mode 100644 man/centralize.scores.Rd diff --git a/R/centralization.R b/R/centralization.R index b6aea8525cc..f35073658bd 100644 --- a/R/centralization.R +++ b/R/centralization.R @@ -1,4 +1,139 @@ +#' Centralization of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralize.scores()` was renamed to `centralize()` to create a more +#' consistent API. +#' @inheritParams centralize +#' @keywords internal +#' @export +centralize.scores <- function(scores , theoretical.max = 0 , normalized = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralize.scores()", "centralize()") + centralize(scores = scores, theoretical.max = theoretical.max, normalized = normalized) +} # nocov end + +#' Theoretical maximum for betweenness centralization +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.evcent.tmax()` was renamed to `centr_eigen_tmax()` to create a more +#' consistent API. +#' @inheritParams centr_eigen_tmax +#' @keywords internal +#' @export +centralization.evcent.tmax <- function(graph = NULL , nodes = 0 , directed = FALSE , scale = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.evcent.tmax()", "centr_eigen_tmax()") + centr_eigen_tmax(graph = graph, nodes = nodes, directed = directed, scale = scale) +} # nocov end + +#' Centralize a graph according to the eigenvector centrality of vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.evcent()` was renamed to `centr_eigen()` to create a more +#' consistent API. +#' @inheritParams centr_eigen +#' @keywords internal +#' @export +centralization.evcent <- function(graph , directed = FALSE , scale = TRUE , options = arpack_defaults() , normalized = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.evcent()", "centr_eigen()") + centr_eigen(graph = graph, directed = directed, scale = scale, options = options, normalized = normalized) +} # nocov end + +#' Theoretical maximum for degree centralization +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.degree.tmax()` was renamed to `centr_degree_tmax()` to create a more +#' consistent API. +#' @inheritParams centr_degree_tmax +#' @keywords internal +#' @export +centralization.degree.tmax <- function(graph = NULL , nodes = 0 , mode = c("all","out","in","total") , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.degree.tmax()", "centr_degree_tmax()") + centr_degree_tmax(graph = graph, nodes = nodes, mode = mode, loops = loops) +} # nocov end + +#' Centralize a graph according to the degrees of vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.degree()` was renamed to `centr_degree()` to create a more +#' consistent API. +#' @inheritParams centr_degree +#' @keywords internal +#' @export +centralization.degree <- function(graph , mode = c("all","out","in","total") , loops = TRUE , normalized = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.degree()", "centr_degree()") + centr_degree(graph = graph, mode = mode, loops = loops, normalized = normalized) +} # nocov end + +#' Theoretical maximum for closeness centralization +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.closeness.tmax()` was renamed to `centr_clo_tmax()` to create a more +#' consistent API. +#' @inheritParams centr_clo_tmax +#' @keywords internal +#' @export +centralization.closeness.tmax <- function(graph = NULL , nodes = 0 , mode = c("out","in","all","total")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.closeness.tmax()", "centr_clo_tmax()") + centr_clo_tmax(graph = graph, nodes = nodes, mode = mode) +} # nocov end + +#' Centralize a graph according to the closeness of vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.closeness()` was renamed to `centr_clo()` to create a more +#' consistent API. +#' @inheritParams centr_clo +#' @keywords internal +#' @export +centralization.closeness <- function(graph , mode = c("out","in","all","total") , normalized = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.closeness()", "centr_clo()") + centr_clo(graph = graph, mode = mode, normalized = normalized) +} # nocov end + +#' Theoretical maximum for betweenness centralization +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.betweenness.tmax()` was renamed to `centr_betw_tmax()` to create a more +#' consistent API. +#' @inheritParams centr_betw_tmax +#' @keywords internal +#' @export +centralization.betweenness.tmax <- function(graph = NULL , nodes = 0 , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.betweenness.tmax()", "centr_betw_tmax()") + centr_betw_tmax(graph = graph, nodes = nodes, directed = directed) +} # nocov end + +#' Centralize a graph according to the betweenness of vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `centralization.betweenness()` was renamed to `centr_betw()` to create a more +#' consistent API. +#' @inheritParams centr_betw +#' @keywords internal +#' @export +centralization.betweenness <- function(graph , directed = TRUE , normalized = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "centralization.betweenness()", "centr_betw()") + centr_betw(graph = graph, directed = directed, normalized = normalized) +} # nocov end + ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -59,7 +194,7 @@ NULL #' @return A real scalar, the centralization of the graph from which #' `scores` were derived. #' -#' @aliases centralization centralize.scores +#' @aliases centralization #' @family centralization related #' #' @export @@ -107,7 +242,6 @@ centralize <- centralization_impl #' using the same parameters. If the `normalized` argument was #' `TRUE`, then the result was divided by this number.} #' -#' @aliases centralization.degree #' @family centralization related #' #' @export @@ -136,7 +270,6 @@ centr_degree <- centralization_degree_impl #' @return Real scalar, the theoretical maximum (unnormalized) graph degree #' centrality score for graphs with given order and other parameters. #' -#' @aliases centralization.degree.tmax #' @family centralization related #' #' @export @@ -189,7 +322,6 @@ centr_degree_tmax <- function(graph = NULL, nodes = 0, mode = c("all", "out", "i #' using the same parameters. If the `normalized` argument was #' `TRUE`, then the result was divided by this number.} #' -#' @aliases centralization.betweenness #' @family centralization related #' #' @export @@ -229,7 +361,6 @@ centr_betw <- function(graph, directed = TRUE, normalized = TRUE) { #' betweenness centrality score for graphs with given order and other #' parameters. #' -#' @aliases centralization.betweenness.tmax #' @family centralization related #' #' @export @@ -259,7 +390,6 @@ centr_betw_tmax <- centralization_betweenness_tmax_impl #' using the same parameters. If the `normalized` argument was #' `TRUE`, then the result was divided by this number.} #' -#' @aliases centralization.closeness #' @family centralization related #' #' @export @@ -287,7 +417,6 @@ centr_clo <- centralization_closeness_impl #' closeness centrality score for graphs with given order and other #' parameters. #' -#' @aliases centralization.closeness.tmax #' @family centralization related #' #' @export @@ -322,7 +451,6 @@ centr_clo_tmax <- centralization_closeness_tmax_impl #' \item{theoretical_max}{The same as above, the theoretical maximum #' centralization score for a graph with the same number of vertices.} #' -#' @aliases centralization.evcent #' @family centralization related #' #' @export @@ -358,7 +486,6 @@ centr_eigen <- centralization_eigenvector_centrality_impl #' betweenness centrality score for graphs with given order and other #' parameters. #' -#' @aliases centralization.evcent.tmax #' @family centralization related #' #' @export @@ -371,20 +498,3 @@ centr_eigen <- centralization_eigenvector_centrality_impl #' centr_eigen(g, normalized = TRUE)$centralization centr_eigen_tmax <- centralization_eigenvector_centrality_tmax_impl #' @export centralization.betweenness -deprecated("centralization.betweenness", centr_betw) -#' @export centralization.betweenness.tmax -deprecated("centralization.betweenness.tmax", centr_betw_tmax) -#' @export centralization.closeness -deprecated("centralization.closeness", centr_clo) -#' @export centralization.closeness.tmax -deprecated("centralization.closeness.tmax", centr_clo_tmax) -#' @export centralization.degree -deprecated("centralization.degree", centr_degree) -#' @export centralization.degree.tmax -deprecated("centralization.degree.tmax", centr_degree_tmax) -#' @export centralization.evcent -deprecated("centralization.evcent", centr_eigen) -#' @export centralization.evcent.tmax -deprecated("centralization.evcent.tmax", centr_eigen_tmax) -#' @export centralize.scores -deprecated("centralize.scores", centralize) diff --git a/man/centr_betw.Rd b/man/centr_betw.Rd index 5c8dd453cca..67d68249dc7 100644 --- a/man/centr_betw.Rd +++ b/man/centr_betw.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_betw} \alias{centr_betw} -\alias{centralization.betweenness} \title{Centralize a graph according to the betweenness of vertices} \usage{ centr_betw(graph, directed = TRUE, normalized = TRUE) diff --git a/man/centr_betw_tmax.Rd b/man/centr_betw_tmax.Rd index 977cad8427b..a1301dcf91d 100644 --- a/man/centr_betw_tmax.Rd +++ b/man/centr_betw_tmax.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_betw_tmax} \alias{centr_betw_tmax} -\alias{centralization.betweenness.tmax} \title{Theoretical maximum for betweenness centralization} \usage{ centr_betw_tmax(graph = NULL, nodes = 0, directed = TRUE) diff --git a/man/centr_clo.Rd b/man/centr_clo.Rd index af1fb78decc..39a27ed8023 100644 --- a/man/centr_clo.Rd +++ b/man/centr_clo.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_clo} \alias{centr_clo} -\alias{centralization.closeness} \title{Centralize a graph according to the closeness of vertices} \usage{ centr_clo(graph, mode = c("out", "in", "all", "total"), normalized = TRUE) diff --git a/man/centr_clo_tmax.Rd b/man/centr_clo_tmax.Rd index 59e6ef568e0..6e42441502a 100644 --- a/man/centr_clo_tmax.Rd +++ b/man/centr_clo_tmax.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_clo_tmax} \alias{centr_clo_tmax} -\alias{centralization.closeness.tmax} \title{Theoretical maximum for closeness centralization} \usage{ centr_clo_tmax(graph = NULL, nodes = 0, mode = c("out", "in", "all", "total")) diff --git a/man/centr_degree.Rd b/man/centr_degree.Rd index f5e66713471..006a67eeee1 100644 --- a/man/centr_degree.Rd +++ b/man/centr_degree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_degree} \alias{centr_degree} -\alias{centralization.degree} \title{Centralize a graph according to the degrees of vertices} \usage{ centr_degree( diff --git a/man/centr_degree_tmax.Rd b/man/centr_degree_tmax.Rd index ef8cb93b249..f2992fd2c23 100644 --- a/man/centr_degree_tmax.Rd +++ b/man/centr_degree_tmax.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_degree_tmax} \alias{centr_degree_tmax} -\alias{centralization.degree.tmax} \title{Theoretical maximum for degree centralization} \usage{ centr_degree_tmax( diff --git a/man/centr_eigen.Rd b/man/centr_eigen.Rd index 2c2a7dfdc3a..53bd39c5932 100644 --- a/man/centr_eigen.Rd +++ b/man/centr_eigen.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_eigen} \alias{centr_eigen} -\alias{centralization.evcent} \title{Centralize a graph according to the eigenvector centrality of vertices} \usage{ centr_eigen( diff --git a/man/centr_eigen_tmax.Rd b/man/centr_eigen_tmax.Rd index 85f40c7205a..09ec1d64449 100644 --- a/man/centr_eigen_tmax.Rd +++ b/man/centr_eigen_tmax.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/centralization.R \name{centr_eigen_tmax} \alias{centr_eigen_tmax} -\alias{centralization.evcent.tmax} \title{Theoretical maximum for betweenness centralization} \usage{ centr_eigen_tmax(graph = NULL, nodes = 0, directed = FALSE, scale = TRUE) diff --git a/man/centralization.betweenness.Rd b/man/centralization.betweenness.Rd new file mode 100644 index 00000000000..e567a4f8318 --- /dev/null +++ b/man/centralization.betweenness.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.betweenness} +\alias{centralization.betweenness} +\title{Centralize a graph according to the betweenness of vertices} +\usage{ +centralization.betweenness(graph, directed = TRUE, normalized = TRUE) +} +\arguments{ +\item{graph}{The input graph.} + +\item{directed}{logical scalar, whether to use directed shortest paths for +calculating betweenness.} + +\item{normalized}{Logical scalar. Whether to normalize the graph level +centrality score by dividing by the theoretical maximum.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.betweenness()} was renamed to \code{centr_betw()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.betweenness.tmax.Rd b/man/centralization.betweenness.tmax.Rd new file mode 100644 index 00000000000..873a004814f --- /dev/null +++ b/man/centralization.betweenness.tmax.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.betweenness.tmax} +\alias{centralization.betweenness.tmax} +\title{Theoretical maximum for betweenness centralization} +\usage{ +centralization.betweenness.tmax(graph = NULL, nodes = 0, directed = TRUE) +} +\arguments{ +\item{graph}{The input graph. It can also be \code{NULL}, if +\code{nodes} is given.} + +\item{nodes}{The number of vertices. This is ignored if the graph is +given.} + +\item{directed}{logical scalar, whether to use directed shortest paths +for calculating betweenness.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.betweenness.tmax()} was renamed to \code{centr_betw_tmax()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.closeness.Rd b/man/centralization.closeness.Rd new file mode 100644 index 00000000000..12036dce49f --- /dev/null +++ b/man/centralization.closeness.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.closeness} +\alias{centralization.closeness} +\title{Centralize a graph according to the closeness of vertices} +\usage{ +centralization.closeness( + graph, + mode = c("out", "in", "all", "total"), + normalized = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{mode}{This is the same as the \code{mode} argument of +\code{closeness()}.} + +\item{normalized}{Logical scalar. Whether to normalize the graph level +centrality score by dividing by the theoretical maximum.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.closeness()} was renamed to \code{centr_clo()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.closeness.tmax.Rd b/man/centralization.closeness.tmax.Rd new file mode 100644 index 00000000000..f87a5b27cba --- /dev/null +++ b/man/centralization.closeness.tmax.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.closeness.tmax} +\alias{centralization.closeness.tmax} +\title{Theoretical maximum for closeness centralization} +\usage{ +centralization.closeness.tmax( + graph = NULL, + nodes = 0, + mode = c("out", "in", "all", "total") +) +} +\arguments{ +\item{graph}{The input graph. It can also be \code{NULL}, if +\code{nodes} is given.} + +\item{nodes}{The number of vertices. This is ignored if the graph is +given.} + +\item{mode}{This is the same as the \code{mode} argument of +\code{closeness()}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.closeness.tmax()} was renamed to \code{centr_clo_tmax()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.degree.Rd b/man/centralization.degree.Rd new file mode 100644 index 00000000000..bed5088d219 --- /dev/null +++ b/man/centralization.degree.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.degree} +\alias{centralization.degree} +\title{Centralize a graph according to the degrees of vertices} +\usage{ +centralization.degree( + graph, + mode = c("all", "out", "in", "total"), + loops = TRUE, + normalized = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{mode}{This is the same as the \code{mode} argument of +\code{degree()}.} + +\item{loops}{Logical scalar, whether to consider loops edges when +calculating the degree.} + +\item{normalized}{Logical scalar. Whether to normalize the graph level +centrality score by dividing by the theoretical maximum.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.degree()} was renamed to \code{centr_degree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.degree.tmax.Rd b/man/centralization.degree.tmax.Rd new file mode 100644 index 00000000000..b71ddbe3df2 --- /dev/null +++ b/man/centralization.degree.tmax.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.degree.tmax} +\alias{centralization.degree.tmax} +\title{Theoretical maximum for degree centralization} +\usage{ +centralization.degree.tmax( + graph = NULL, + nodes = 0, + mode = c("all", "out", "in", "total"), + loops = FALSE +) +} +\arguments{ +\item{graph}{The input graph. It can also be \code{NULL}, if +\code{nodes}, \code{mode} and \code{loops} are all given.} + +\item{nodes}{The number of vertices. This is ignored if the graph is given.} + +\item{mode}{This is the same as the \code{mode} argument of +\code{degree()}.} + +\item{loops}{Logical scalar, whether to consider loops edges when +calculating the degree. Currently the default value is \code{FALSE}, +but this argument will be required from igraph 1.4.0.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.degree.tmax()} was renamed to \code{centr_degree_tmax()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.evcent.Rd b/man/centralization.evcent.Rd new file mode 100644 index 00000000000..7ea5b0ca71a --- /dev/null +++ b/man/centralization.evcent.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.evcent} +\alias{centralization.evcent} +\title{Centralize a graph according to the eigenvector centrality of vertices} +\usage{ +centralization.evcent( + graph, + directed = FALSE, + scale = TRUE, + options = arpack_defaults(), + normalized = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{directed}{logical scalar, whether to use directed shortest paths for +calculating eigenvector centrality.} + +\item{scale}{Whether to rescale the eigenvector centrality scores, such that +the maximum score is one.} + +\item{options}{This is passed to \code{\link[=eigen_centrality]{eigen_centrality()}}, the options +for the ARPACK eigensolver.} + +\item{normalized}{Logical scalar. Whether to normalize the graph level +centrality score by dividing by the theoretical maximum.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.evcent()} was renamed to \code{centr_eigen()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralization.evcent.tmax.Rd b/man/centralization.evcent.tmax.Rd new file mode 100644 index 00000000000..a363342efea --- /dev/null +++ b/man/centralization.evcent.tmax.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralization.evcent.tmax} +\alias{centralization.evcent.tmax} +\title{Theoretical maximum for betweenness centralization} +\usage{ +centralization.evcent.tmax( + graph = NULL, + nodes = 0, + directed = FALSE, + scale = TRUE +) +} +\arguments{ +\item{graph}{The input graph. It can also be \code{NULL}, if +\code{nodes} is given.} + +\item{nodes}{The number of vertices. This is ignored if the graph is +given.} + +\item{directed}{logical scalar, whether to use directed shortest paths +for calculating betweenness.} + +\item{scale}{Whether to rescale the eigenvector centrality scores, +such that the maximum score is one.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralization.evcent.tmax()} was renamed to \code{centr_eigen_tmax()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/centralize.Rd b/man/centralize.Rd index f72e0c2610f..6499a6d591a 100644 --- a/man/centralize.Rd +++ b/man/centralize.Rd @@ -3,7 +3,6 @@ \name{centralize} \alias{centralize} \alias{centralization} -\alias{centralize.scores} \title{Centralization of a graph} \usage{ centralize(scores, theoretical.max = 0, normalized = TRUE) diff --git a/man/centralize.scores.Rd b/man/centralize.scores.Rd new file mode 100644 index 00000000000..9e6aba7ad6d --- /dev/null +++ b/man/centralize.scores.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/centralization.R +\name{centralize.scores} +\alias{centralize.scores} +\title{Centralization of a graph} +\usage{ +centralize.scores(scores, theoretical.max = 0, normalized = TRUE) +} +\arguments{ +\item{scores}{The vertex level centrality scores.} + +\item{theoretical.max}{Real scalar. The graph-level centralization measure of +the most centralized graph with the same number of vertices as the graph +under study. This is only used if the \code{normalized} argument is set +to \code{TRUE}.} + +\item{normalized}{Logical scalar. Whether to normalize the graph level +centrality score by dividing by the supplied theoretical maximum.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{centralize.scores()} was renamed to \code{centralize()} to create a more +consistent API. +} +\keyword{internal} From 0b82979a85324a5572c9d5fd3e4634cbf738314d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:54:58 +0100 Subject: [PATCH 11/48] refactor!: change R/cliques.R --- R/cliques.R | 138 +++++++++++++++++++++---- man/clique.number.Rd | 19 ++++ man/cliques.Rd | 4 - man/independence.number.Rd | 19 ++++ man/independent.vertex.sets.Rd | 25 +++++ man/ivs.Rd | 4 - man/largest.cliques.Rd | 19 ++++ man/largest.independent.vertex.sets.Rd | 19 ++++ man/maximal.cliques.Rd | 37 +++++++ man/maximal.cliques.count.Rd | 31 ++++++ man/maximal.independent.vertex.sets.Rd | 19 ++++ 11 files changed, 308 insertions(+), 26 deletions(-) create mode 100644 man/clique.number.Rd create mode 100644 man/independence.number.Rd create mode 100644 man/independent.vertex.sets.Rd create mode 100644 man/largest.cliques.Rd create mode 100644 man/largest.independent.vertex.sets.Rd create mode 100644 man/maximal.cliques.Rd create mode 100644 man/maximal.cliques.count.Rd create mode 100644 man/maximal.independent.vertex.sets.Rd diff --git a/R/cliques.R b/R/cliques.R index 35f0b41cdf0..a80681f5f03 100644 --- a/R/cliques.R +++ b/R/cliques.R @@ -1,3 +1,123 @@ + +#' Independent vertex sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maximal.independent.vertex.sets()` was renamed to `maximal_ivs()` to create a more +#' consistent API. +#' @inheritParams maximal_ivs +#' @keywords internal +#' @export +maximal.independent.vertex.sets <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maximal.independent.vertex.sets()", "maximal_ivs()") + maximal_ivs(graph = graph) +} # nocov end + +#' Functions to find cliques, i.e. complete subgraphs in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maximal.cliques.count()` was renamed to `count_max_cliques()` to create a more +#' consistent API. +#' @inheritParams count_max_cliques +#' @keywords internal +#' @export +maximal.cliques.count <- function(graph , min = NULL , max = NULL , subset = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maximal.cliques.count()", "count_max_cliques()") + count_max_cliques(graph = graph, min = min, max = max, subset = subset) +} # nocov end + +#' Functions to find cliques, i.e. complete subgraphs in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maximal.cliques()` was renamed to `max_cliques()` to create a more +#' consistent API. +#' @inheritParams max_cliques +#' @keywords internal +#' @export +maximal.cliques <- function(graph , min = NULL , max = NULL , subset = NULL , file = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maximal.cliques()", "max_cliques()") + max_cliques(graph = graph, min = min, max = max, subset = subset, file = file) +} # nocov end + +#' Independent vertex sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `largest.independent.vertex.sets()` was renamed to `largest_ivs()` to create a more +#' consistent API. +#' @inheritParams largest_ivs +#' @keywords internal +#' @export +largest.independent.vertex.sets <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "largest.independent.vertex.sets()", "largest_ivs()") + largest_ivs(graph = graph) +} # nocov end + +#' Functions to find cliques, i.e. complete subgraphs in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `largest.cliques()` was renamed to `largest_cliques()` to create a more +#' consistent API. +#' @inheritParams largest_cliques +#' @keywords internal +#' @export +largest.cliques <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "largest.cliques()", "largest_cliques()") + largest_cliques(graph = graph) +} # nocov end + +#' Independent vertex sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `independent.vertex.sets()` was renamed to `ivs()` to create a more +#' consistent API. +#' @inheritParams ivs +#' @keywords internal +#' @export +independent.vertex.sets <- function(graph , min = NULL , max = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "independent.vertex.sets()", "ivs()") + ivs(graph = graph, min = min, max = max) +} # nocov end + +#' Independent vertex sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `independence.number()` was renamed to `ivs_size()` to create a more +#' consistent API. +#' @inheritParams ivs_size +#' @keywords internal +#' @export +independence.number <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "independence.number()", "ivs_size()") + ivs_size(graph = graph) +} # nocov end + +#' Functions to find cliques, i.e. complete subgraphs in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `clique.number()` was renamed to `clique_num()` to create a more +#' consistent API. +#' @inheritParams clique_num +#' @keywords internal +#' @export +clique.number <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "clique.number()", "clique_num()") + clique_num(graph = graph) +} # nocov end # IGraph R package # Copyright (C) 2006-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -44,7 +164,6 @@ #' `clique_size_counts()` returns a numeric vector representing a histogram #' of clique sizes, between the given minimum and maximum clique size. #' -#' @aliases maximal.cliques maximal.cliques.count clique.number largest.cliques #' @inheritParams weighted_cliques #' @param graph The input graph, directed graphs will be considered as #' undirected ones, multiple edges and loops are ignored. @@ -268,8 +387,6 @@ weighted_clique_num <- weighted_clique_number_impl #' These functions use the algorithm described by Tsukiyama et al., see #' reference below. #' -#' @aliases independent.vertex.sets largest.independent.vertex.sets -#' maximal.independent.vertex.sets independence.number #' @param graph The input graph, directed graphs are considered as undirected, #' loop edges and multiple edges are ignored. #' @param min Numeric constant, limit for the minimum size of the independent @@ -382,18 +499,3 @@ clique_size_counts <- function(graph, min = 0, max = 0, maximal = FALSE) { } } #' @export clique.number -deprecated("clique.number", clique_num) -#' @export independence.number -deprecated("independence.number", ivs_size) -#' @export independent.vertex.sets -deprecated("independent.vertex.sets", ivs) -#' @export largest.cliques -deprecated("largest.cliques", largest_cliques) -#' @export largest.independent.vertex.sets -deprecated("largest.independent.vertex.sets", largest_ivs) -#' @export maximal.cliques -deprecated("maximal.cliques", max_cliques) -#' @export maximal.cliques.count -deprecated("maximal.cliques.count", count_max_cliques) -#' @export maximal.independent.vertex.sets -deprecated("maximal.independent.vertex.sets", maximal_ivs) diff --git a/man/clique.number.Rd b/man/clique.number.Rd new file mode 100644 index 00000000000..19de05ff156 --- /dev/null +++ b/man/clique.number.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{clique.number} +\alias{clique.number} +\title{Functions to find cliques, i.e. complete subgraphs in a graph} +\usage{ +clique.number(graph) +} +\arguments{ +\item{graph}{The input graph, directed graphs will be considered as +undirected ones, multiple edges and loops are ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{clique.number()} was renamed to \code{clique_num()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/cliques.Rd b/man/cliques.Rd index b2480c36b12..93698c19ecb 100644 --- a/man/cliques.Rd +++ b/man/cliques.Rd @@ -2,10 +2,6 @@ % Please edit documentation in R/cliques.R \name{cliques} \alias{cliques} -\alias{maximal.cliques} -\alias{maximal.cliques.count} -\alias{clique.number} -\alias{largest.cliques} \alias{largest_cliques} \alias{max_cliques} \alias{count_max_cliques} diff --git a/man/independence.number.Rd b/man/independence.number.Rd new file mode 100644 index 00000000000..0c31fbea555 --- /dev/null +++ b/man/independence.number.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{independence.number} +\alias{independence.number} +\title{Independent vertex sets} +\usage{ +independence.number(graph) +} +\arguments{ +\item{graph}{The input graph, directed graphs are considered as undirected, +loop edges and multiple edges are ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{independence.number()} was renamed to \code{ivs_size()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/independent.vertex.sets.Rd b/man/independent.vertex.sets.Rd new file mode 100644 index 00000000000..c1c2b5f3007 --- /dev/null +++ b/man/independent.vertex.sets.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{independent.vertex.sets} +\alias{independent.vertex.sets} +\title{Independent vertex sets} +\usage{ +independent.vertex.sets(graph, min = NULL, max = NULL) +} +\arguments{ +\item{graph}{The input graph, directed graphs are considered as undirected, +loop edges and multiple edges are ignored.} + +\item{min}{Numeric constant, limit for the minimum size of the independent +vertex sets to find. \code{NULL} means no limit.} + +\item{max}{Numeric constant, limit for the maximum size of the independent +vertex sets to find. \code{NULL} means no limit.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{independent.vertex.sets()} was renamed to \code{ivs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/ivs.Rd b/man/ivs.Rd index a8dd5500694..ef9c3c443c5 100644 --- a/man/ivs.Rd +++ b/man/ivs.Rd @@ -2,10 +2,6 @@ % Please edit documentation in R/cliques.R \name{ivs} \alias{ivs} -\alias{independent.vertex.sets} -\alias{largest.independent.vertex.sets} -\alias{maximal.independent.vertex.sets} -\alias{independence.number} \alias{largest_ivs} \alias{maximal_ivs} \alias{ivs_size} diff --git a/man/largest.cliques.Rd b/man/largest.cliques.Rd new file mode 100644 index 00000000000..53de3293670 --- /dev/null +++ b/man/largest.cliques.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{largest.cliques} +\alias{largest.cliques} +\title{Functions to find cliques, i.e. complete subgraphs in a graph} +\usage{ +largest.cliques(graph) +} +\arguments{ +\item{graph}{The input graph, directed graphs will be considered as +undirected ones, multiple edges and loops are ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{largest.cliques()} was renamed to \code{largest_cliques()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/largest.independent.vertex.sets.Rd b/man/largest.independent.vertex.sets.Rd new file mode 100644 index 00000000000..384fd15f547 --- /dev/null +++ b/man/largest.independent.vertex.sets.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{largest.independent.vertex.sets} +\alias{largest.independent.vertex.sets} +\title{Independent vertex sets} +\usage{ +largest.independent.vertex.sets(graph) +} +\arguments{ +\item{graph}{The input graph, directed graphs are considered as undirected, +loop edges and multiple edges are ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{largest.independent.vertex.sets()} was renamed to \code{largest_ivs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/maximal.cliques.Rd b/man/maximal.cliques.Rd new file mode 100644 index 00000000000..191e3aa9092 --- /dev/null +++ b/man/maximal.cliques.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{maximal.cliques} +\alias{maximal.cliques} +\title{Functions to find cliques, i.e. complete subgraphs in a graph} +\usage{ +maximal.cliques(graph, min = NULL, max = NULL, subset = NULL, file = NULL) +} +\arguments{ +\item{graph}{The input graph, directed graphs will be considered as +undirected ones, multiple edges and loops are ignored.} + +\item{min}{Numeric constant, lower limit on the size of the cliques to find. +\code{NULL} means no limit, i.e. it is the same as 0.} + +\item{max}{Numeric constant, upper limit on the size of the cliques to find. +\code{NULL} means no limit.} + +\item{subset}{If not \code{NULL}, then it must be a vector of vertex ids, +numeric or symbolic if the graph is named. The algorithm is run from these +vertices only, so only a subset of all maximal cliques is returned. See the +Eppstein paper for details. This argument makes it possible to easily +parallelize the finding of maximal cliques.} + +\item{file}{If not \code{NULL}, then it must be a file name, i.e. a +character scalar. The output of the algorithm is written to this file. (If +it exists, then it will be overwritten.) Each clique will be a separate line +in the file, given with the numeric ids of its vertices, separated by +whitespace.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maximal.cliques()} was renamed to \code{max_cliques()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/maximal.cliques.count.Rd b/man/maximal.cliques.count.Rd new file mode 100644 index 00000000000..840a7e0db14 --- /dev/null +++ b/man/maximal.cliques.count.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{maximal.cliques.count} +\alias{maximal.cliques.count} +\title{Functions to find cliques, i.e. complete subgraphs in a graph} +\usage{ +maximal.cliques.count(graph, min = NULL, max = NULL, subset = NULL) +} +\arguments{ +\item{graph}{The input graph, directed graphs will be considered as +undirected ones, multiple edges and loops are ignored.} + +\item{min}{Numeric constant, lower limit on the size of the cliques to find. +\code{NULL} means no limit, i.e. it is the same as 0.} + +\item{max}{Numeric constant, upper limit on the size of the cliques to find. +\code{NULL} means no limit.} + +\item{subset}{If not \code{NULL}, then it must be a vector of vertex ids, +numeric or symbolic if the graph is named. The algorithm is run from these +vertices only, so only a subset of all maximal cliques is returned. See the +Eppstein paper for details. This argument makes it possible to easily +parallelize the finding of maximal cliques.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maximal.cliques.count()} was renamed to \code{count_max_cliques()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/maximal.independent.vertex.sets.Rd b/man/maximal.independent.vertex.sets.Rd new file mode 100644 index 00000000000..9e53faec2d5 --- /dev/null +++ b/man/maximal.independent.vertex.sets.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cliques.R +\name{maximal.independent.vertex.sets} +\alias{maximal.independent.vertex.sets} +\title{Independent vertex sets} +\usage{ +maximal.independent.vertex.sets(graph) +} +\arguments{ +\item{graph}{The input graph, directed graphs are considered as undirected, +loop edges and multiple edges are ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maximal.independent.vertex.sets()} was renamed to \code{maximal_ivs()} to create a more +consistent API. +} +\keyword{internal} From f9e0417af122f6eb59a4fb53b7c63400b907f465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:55:27 +0100 Subject: [PATCH 12/48] refactor!: change R/cohesive.blocks.R --- R/cohesive.blocks.R | 107 +++++++++++++++++++++++++++++++++++------ man/blockGraphs.Rd | 24 +++++++++ man/cohesive.blocks.Rd | 28 +++++++++++ man/cohesive_blocks.Rd | 5 -- man/exportPajek.Rd | 40 +++++++++++++++ man/graph.cohesion.Rd | 20 ++++++++ man/maxcohesion.Rd | 15 ++++++ man/plotHierarchy.Rd | 27 +++++++++++ 8 files changed, 247 insertions(+), 19 deletions(-) create mode 100644 man/blockGraphs.Rd create mode 100644 man/cohesive.blocks.Rd create mode 100644 man/exportPajek.Rd create mode 100644 man/graph.cohesion.Rd create mode 100644 man/maxcohesion.Rd create mode 100644 man/plotHierarchy.Rd diff --git a/R/cohesive.blocks.R b/R/cohesive.blocks.R index 5d100e72bed..6097204448f 100644 --- a/R/cohesive.blocks.R +++ b/R/cohesive.blocks.R @@ -1,3 +1,94 @@ + +#' Calculate Cohesive Blocks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `exportPajek()` was renamed to `export_pajek()` to create a more +#' consistent API. +#' @inheritParams export_pajek +#' @keywords internal +#' @export +exportPajek <- function(blocks , graph , file , project.file = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "exportPajek()", "export_pajek()") + export_pajek(blocks = blocks, graph = graph, file = file, project.file = project.file) +} # nocov end + +#' Calculate Cohesive Blocks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `plotHierarchy()` was renamed to `plot_hierarchy()` to create a more +#' consistent API. +#' @inheritParams plot_hierarchy +#' @keywords internal +#' @export +plotHierarchy <- function(blocks , layout = layout_as_tree(hierarchy(blocks),root=1) , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "plotHierarchy()", "plot_hierarchy()") + plot_hierarchy(blocks = blocks, layout = layout, ...) +} # nocov end + +#' Calculate Cohesive Blocks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maxcohesion()` was renamed to `max_cohesion()` to create a more +#' consistent API. +#' @inheritParams max_cohesion +#' @keywords internal +#' @export +maxcohesion <- function(blocks) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maxcohesion()", "max_cohesion()") + max_cohesion(blocks = blocks) +} # nocov end + +#' Vertex connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.cohesion()` was renamed to `cohesion()` to create a more +#' consistent API. +#' @param x graph +#' @param ... passed to `cohesion()` +#' @keywords internal +#' @export +graph.cohesion <- function(x , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.cohesion()", "cohesion()") + cohesion(x = x, ...) +} # nocov end + +#' Calculate Cohesive Blocks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `cohesive.blocks()` was renamed to `cohesive_blocks()` to create a more +#' consistent API. +#' @inheritParams cohesive_blocks +#' @keywords internal +#' @export +cohesive.blocks <- function(graph , labels = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "cohesive.blocks()", "cohesive_blocks()") + cohesive_blocks(graph = graph, labels = labels) +} # nocov end + +#' Calculate Cohesive Blocks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `blockGraphs()` was renamed to `graphs_from_cohesive_blocks()` to create a more +#' consistent API. +#' @inheritParams graphs_from_cohesive_blocks +#' @keywords internal +#' @export +blockGraphs <- function(blocks , graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "blockGraphs()", "graphs_from_cohesive_blocks()") + graphs_from_cohesive_blocks(blocks = blocks, graph = graph) +} # nocov end # IGraph R package # Copyright (C) 2010-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -108,10 +199,9 @@ #' The generic function [plot()] plots the graph, showing one or more #' cohesive blocks in it. #' -#' @aliases cohesive.blocks cohesiveBlocks blocks blockGraphs -#' hierarchy parent plotHierarchy export_pajek maxcohesion plot.cohesiveBlocks +#' @aliases cohesiveBlocks blocks +#' @aliases hierarchy parent export_pajek plot.cohesiveBlocks #' summary.cohesiveBlocks length.cohesiveBlocks print.cohesiveBlocks -#' exportPajek #' @param graph For `cohesive_blocks()` a graph object of class #' `igraph`. It must be undirected and simple. (See #' [is_simple()].) @@ -600,14 +690,3 @@ max_cohesion <- function(blocks) { ## '- B-5 c. 3, n. 4 [ 1] ......o.oo o......... ## [21] ... #' @export blockGraphs -deprecated("blockGraphs", graphs_from_cohesive_blocks) -#' @export cohesive.blocks -deprecated("cohesive.blocks", cohesive_blocks) -#' @export graph.cohesion -deprecated("graph.cohesion", cohesion) -#' @export maxcohesion -deprecated("maxcohesion", max_cohesion) -#' @export plotHierarchy -deprecated("plotHierarchy", plot_hierarchy) -#' @export exportPajek -deprecated("exportPajek", export_pajek) diff --git a/man/blockGraphs.Rd b/man/blockGraphs.Rd new file mode 100644 index 00000000000..547f1a07868 --- /dev/null +++ b/man/blockGraphs.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{blockGraphs} +\alias{blockGraphs} +\title{Calculate Cohesive Blocks} +\usage{ +blockGraphs(blocks, graph) +} +\arguments{ +\item{graph}{For \code{cohesive_blocks()} a graph object of class +\code{igraph}. It must be undirected and simple. (See +\code{\link[=is_simple]{is_simple()}}.) + +For \code{graphs_from_cohesive_blocks()} and \code{export_pajek()} the same graph must be +supplied whose cohesive block structure is given in the \code{blocks()} +argument.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{blockGraphs()} was renamed to \code{graphs_from_cohesive_blocks()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/cohesive.blocks.Rd b/man/cohesive.blocks.Rd new file mode 100644 index 00000000000..363c6c420fe --- /dev/null +++ b/man/cohesive.blocks.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{cohesive.blocks} +\alias{cohesive.blocks} +\title{Calculate Cohesive Blocks} +\usage{ +cohesive.blocks(graph, labels = TRUE) +} +\arguments{ +\item{graph}{For \code{cohesive_blocks()} a graph object of class +\code{igraph}. It must be undirected and simple. (See +\code{\link[=is_simple]{is_simple()}}.) + +For \code{graphs_from_cohesive_blocks()} and \code{export_pajek()} the same graph must be +supplied whose cohesive block structure is given in the \code{blocks()} +argument.} + +\item{labels}{Logical scalar, whether to add the vertex labels to the result +object. These labels can be then used when reporting and plotting the +cohesive blocks.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{cohesive.blocks()} was renamed to \code{cohesive_blocks()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/cohesive_blocks.Rd b/man/cohesive_blocks.Rd index 6689ab24fe4..84ce39caa53 100644 --- a/man/cohesive_blocks.Rd +++ b/man/cohesive_blocks.Rd @@ -2,20 +2,15 @@ % Please edit documentation in R/cohesive.blocks.R \name{cohesive_blocks} \alias{cohesive_blocks} -\alias{cohesive.blocks} \alias{cohesiveBlocks} \alias{blocks} -\alias{blockGraphs} \alias{hierarchy} \alias{parent} -\alias{plotHierarchy} \alias{export_pajek} -\alias{maxcohesion} \alias{plot.cohesiveBlocks} \alias{summary.cohesiveBlocks} \alias{length.cohesiveBlocks} \alias{print.cohesiveBlocks} -\alias{exportPajek} \alias{graphs_from_cohesive_blocks} \alias{cohesion.cohesiveBlocks} \alias{plot_hierarchy} diff --git a/man/exportPajek.Rd b/man/exportPajek.Rd new file mode 100644 index 00000000000..f5d0b564d5d --- /dev/null +++ b/man/exportPajek.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{exportPajek} +\alias{exportPajek} +\title{Calculate Cohesive Blocks} +\usage{ +exportPajek(blocks, graph, file, project.file = TRUE) +} +\arguments{ +\item{graph}{For \code{cohesive_blocks()} a graph object of class +\code{igraph}. It must be undirected and simple. (See +\code{\link[=is_simple]{is_simple()}}.) + +For \code{graphs_from_cohesive_blocks()} and \code{export_pajek()} the same graph must be +supplied whose cohesive block structure is given in the \code{blocks()} +argument.} + +\item{file}{Defines the file (or connection) the Pajek file is written to. + +If the \code{project.file} argument is \code{TRUE}, then it can be a +filename (with extension), a file object, or in general any king of +connection object. The file/connection will be opened if it wasn't already. + +If the \code{project.file} argument is \code{FALSE}, then several files are +created and \code{file} must be a character scalar containing the base name +of the files, without extension. (But it can contain the path to the files.) + +See also details below.} + +\item{project.file}{Logical scalar, whether to create a single Pajek project +file containing all the data, or to create separated files for each item. +See details below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{exportPajek()} was renamed to \code{export_pajek()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.cohesion.Rd b/man/graph.cohesion.Rd new file mode 100644 index 00000000000..b248eae8a00 --- /dev/null +++ b/man/graph.cohesion.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{graph.cohesion} +\alias{graph.cohesion} +\title{Vertex connectivity} +\usage{ +graph.cohesion(x, ...) +} +\arguments{ +\item{x}{graph} + +\item{...}{passed to \code{cohesion()}} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.cohesion()} was renamed to \code{cohesion()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/maxcohesion.Rd b/man/maxcohesion.Rd new file mode 100644 index 00000000000..909b4b50c75 --- /dev/null +++ b/man/maxcohesion.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{maxcohesion} +\alias{maxcohesion} +\title{Calculate Cohesive Blocks} +\usage{ +maxcohesion(blocks) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maxcohesion()} was renamed to \code{max_cohesion()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/plotHierarchy.Rd b/man/plotHierarchy.Rd new file mode 100644 index 00000000000..b14305576c5 --- /dev/null +++ b/man/plotHierarchy.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cohesive.blocks.R +\name{plotHierarchy} +\alias{plotHierarchy} +\title{Calculate Cohesive Blocks} +\usage{ +plotHierarchy( + blocks, + layout = layout_as_tree(hierarchy(blocks), root = 1), + ... +) +} +\arguments{ +\item{layout}{The layout of a plot, it is simply passed on to +\code{plot.igraph()}, see the possible formats there. By default the +Reingold-Tilford layout generator is used.} + +\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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{plotHierarchy()} was renamed to \code{plot_hierarchy()} to create a more +consistent API. +} +\keyword{internal} From 992a7442dc385e2d3f8ebaac217fe2562314a794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:56:01 +0100 Subject: [PATCH 13/48] refactor!: change R/community.R --- R/community.R | 303 ++++++++++++++++++++++----- man/as_membership.Rd | 1 - man/cluster_edge_betweenness.Rd | 2 - man/cluster_fast_greedy.Rd | 2 - man/cluster_fluid_communities.Rd | 1 - man/cluster_infomap.Rd | 2 - man/cluster_label_prop.Rd | 2 - man/cluster_leading_eigen.Rd | 2 - man/cluster_leiden.Rd | 1 - man/cluster_louvain.Rd | 2 - man/cluster_optimal.Rd | 2 - man/cluster_spinglass.Rd | 2 - man/cluster_walktrap.Rd | 2 - man/code.length.Rd | 15 ++ man/communities.Rd | 40 +--- man/compare.Rd | 1 - man/contract.Rd | 1 - man/contract.vertices.Rd | 29 +++ man/create.communities.Rd | 38 ++++ man/cutat.Rd | 23 ++ man/dendPlot.Rd | 24 +++ man/edge.betweenness.community.Rd | 65 ++++++ man/fastgreedy.community.Rd | 41 ++++ man/groups.Rd | 1 - man/infomap.community.Rd | 43 ++++ man/is.hierarchical.Rd | 15 ++ man/label.propagation.community.Rd | 43 ++++ man/leading.eigenvector.community.Rd | 52 +++++ man/make_clusters.Rd | 2 - man/mod.matrix.Rd | 27 +++ man/modularity.igraph.Rd | 2 - man/multilevel.community.Rd | 32 +++ man/optimal.community.Rd | 27 +++ man/plot_dendrogram.communities.Rd | 2 - man/showtrace.Rd | 15 ++ man/spinglass.community.Rd | 94 +++++++++ man/split_join_distance.Rd | 1 - man/walktrap.community.Rd | 47 +++++ 38 files changed, 895 insertions(+), 109 deletions(-) create mode 100644 man/code.length.Rd create mode 100644 man/contract.vertices.Rd create mode 100644 man/create.communities.Rd create mode 100644 man/cutat.Rd create mode 100644 man/dendPlot.Rd create mode 100644 man/edge.betweenness.community.Rd create mode 100644 man/fastgreedy.community.Rd create mode 100644 man/infomap.community.Rd create mode 100644 man/is.hierarchical.Rd create mode 100644 man/label.propagation.community.Rd create mode 100644 man/leading.eigenvector.community.Rd create mode 100644 man/mod.matrix.Rd create mode 100644 man/multilevel.community.Rd create mode 100644 man/optimal.community.Rd create mode 100644 man/showtrace.Rd create mode 100644 man/spinglass.community.Rd create mode 100644 man/walktrap.community.Rd diff --git a/R/community.R b/R/community.R index 6945e00a51a..ba42f5d8e33 100644 --- a/R/community.R +++ b/R/community.R @@ -1,3 +1,258 @@ + +#' Creates a communities object. +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `create.communities()` was renamed to `make_clusters()` to create a more +#' consistent API. +#' @inheritParams make_clusters +#' @keywords internal +#' @export +create.communities <- function(graph , membership = NULL , algorithm = NULL , merges = NULL , modularity = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "create.communities()", "make_clusters()") + make_clusters(graph = graph, membership = membership, algorithm = algorithm, merges = merges, modularity = modularity) +} # nocov end + +#' Community structure via short random walks +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `walktrap.community()` was renamed to `cluster_walktrap()` to create a more +#' consistent API. +#' @inheritParams cluster_walktrap +#' @keywords internal +#' @export +walktrap.community <- function(graph , weights = NULL , steps = 4 , merges = TRUE , modularity = TRUE , membership = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "walktrap.community()", "cluster_walktrap()") + cluster_walktrap(graph = graph, weights = weights, steps = steps, merges = merges, modularity = modularity, membership = membership) +} # nocov end + +#' Finding communities in graphs based on statistical meachanics +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `spinglass.community()` was renamed to `cluster_spinglass()` to create a more +#' consistent API. +#' @inheritParams cluster_spinglass +#' @keywords internal +#' @export +spinglass.community <- function(graph , weights = NULL , vertex = NULL , spins = 25 , parupdate = FALSE , start.temp = 1 , stop.temp = 0.01 , cool.fact = 0.99 , update.rule = c("config","random","simple") , gamma = 1.0 , implementation = c("orig","neg") , gamma.minus = 1.0) { # nocov start + lifecycle::deprecate_soft("1.6.0", "spinglass.community()", "cluster_spinglass()") + cluster_spinglass(graph = graph, weights = weights, vertex = vertex, spins = spins, parupdate = parupdate, start.temp = start.temp, stop.temp = stop.temp, cool.fact = cool.fact, update.rule = update.rule, gamma = gamma, implementation = implementation, gamma.minus = gamma.minus) +} # nocov end + +#' Functions to deal with the result of network community detection +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `showtrace()` was renamed to `show_trace()` to create a more +#' consistent API. +#' @inheritParams show_trace +#' @keywords internal +#' @export +showtrace <- function(communities) { # nocov start + lifecycle::deprecate_soft("1.6.0", "showtrace()", "show_trace()") + show_trace(communities = communities) +} # nocov end + +#' Optimal community structure +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `optimal.community()` was renamed to `cluster_optimal()` to create a more +#' consistent API. +#' @inheritParams cluster_optimal +#' @keywords internal +#' @export +optimal.community <- function(graph , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "optimal.community()", "cluster_optimal()") + cluster_optimal(graph = graph, weights = weights) +} # nocov end + +#' Finding community structure by multi-level optimization of modularity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `multilevel.community()` was renamed to `cluster_louvain()` to create a more +#' consistent API. +#' @inheritParams cluster_louvain +#' @keywords internal +#' @export +multilevel.community <- function(graph , weights = NULL , resolution = 1) { # nocov start + lifecycle::deprecate_soft("1.6.0", "multilevel.community()", "cluster_louvain()") + cluster_louvain(graph = graph, weights = weights, resolution = resolution) +} # nocov end + +#' Modularity of a community structure of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `mod.matrix()` was renamed to `modularity_matrix()` to create a more +#' consistent API. +#' @inheritParams modularity_matrix +#' @keywords internal +#' @export +mod.matrix <- function(graph , membership , weights = NULL , resolution = 1 , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "mod.matrix()", "modularity_matrix()") + modularity_matrix(graph = graph, membership = membership, weights = weights, resolution = resolution, directed = directed) +} # nocov end + +#' Community structure detecting based on the leading eigenvector of the community matrix +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `leading.eigenvector.community()` was renamed to `cluster_leading_eigen()` to create a more +#' consistent API. +#' @inheritParams cluster_leading_eigen +#' @keywords internal +#' @export +leading.eigenvector.community <- function(graph , steps = -1 , weights = NULL , start = NULL , options = arpack_defaults() , callback = NULL , extra = NULL , env = parent.frame()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "leading.eigenvector.community()", "cluster_leading_eigen()") + cluster_leading_eigen(graph = graph, steps = steps, weights = weights, start = start, options = options, callback = callback, extra = extra, env = env) +} # nocov end + +#' Finding communities based on propagating labels +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `label.propagation.community()` was renamed to `cluster_label_prop()` to create a more +#' consistent API. +#' @inheritParams cluster_label_prop +#' @keywords internal +#' @export +label.propagation.community <- function(graph , weights = NULL , ... , initial = NULL , fixed = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "label.propagation.community()", "cluster_label_prop()") + cluster_label_prop(graph = graph, weights = weights, initial = initial, fixed = fixed, ...) +} # nocov end + +#' Functions to deal with the result of network community detection +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.hierarchical()` was renamed to `is_hierarchical()` to create a more +#' consistent API. +#' @inheritParams is_hierarchical +#' @keywords internal +#' @export +is.hierarchical <- function(communities) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.hierarchical()", "is_hierarchical()") + is_hierarchical(communities = communities) +} # nocov end + +#' Infomap community finding +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `infomap.community()` was renamed to `cluster_infomap()` to create a more +#' consistent API. +#' @inheritParams cluster_infomap +#' @keywords internal +#' @export +infomap.community <- function(graph , e.weights = NULL , v.weights = NULL , nb.trials = 10 , modularity = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "infomap.community()", "cluster_infomap()") + cluster_infomap(graph = graph, e.weights = e.weights, v.weights = v.weights, nb.trials = nb.trials, modularity = modularity) +} # nocov end + +#' Community structure via greedy optimization of modularity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `fastgreedy.community()` was renamed to `cluster_fast_greedy()` to create a more +#' consistent API. +#' @inheritParams cluster_fast_greedy +#' @keywords internal +#' @export +fastgreedy.community <- function(graph , merges = TRUE , modularity = TRUE , membership = TRUE , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "fastgreedy.community()", "cluster_fast_greedy()") + cluster_fast_greedy(graph = graph, merges = merges, modularity = modularity, membership = membership, weights = weights) +} # nocov end + +#' Community structure detection based on edge betweenness +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `edge.betweenness.community()` was renamed to `cluster_edge_betweenness()` to create a more +#' consistent API. +#' @inheritParams cluster_edge_betweenness +#' @keywords internal +#' @export +edge.betweenness.community <- function(graph , weights = NULL , directed = TRUE , edge.betweenness = TRUE , merges = TRUE , bridges = TRUE , modularity = TRUE , membership = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "edge.betweenness.community()", "cluster_edge_betweenness()") + cluster_edge_betweenness(graph = graph, weights = weights, directed = directed, edge.betweenness = edge.betweenness, merges = merges, bridges = bridges, modularity = modularity, membership = membership) +} # nocov end + +#' Community structure dendrogram plots +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `dendPlot()` was renamed to `plot_dendrogram()` to create a more +#' consistent API. +#' @inheritParams plot_dendrogram +#' @keywords internal +#' @export +dendPlot <- function(x , mode = igraph_opt("dend.plot.type") , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "dendPlot()", "plot_dendrogram()") + plot_dendrogram(x = x, mode = mode, ...) +} # nocov end + +#' Functions to deal with the result of network community detection +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `cutat()` was renamed to `cut_at()` to create a more +#' consistent API. +#' @inheritParams cut_at +#' @keywords internal +#' @export +cutat <- function(communities , no , steps) { # nocov start + lifecycle::deprecate_soft("1.6.0", "cutat()", "cut_at()") + cut_at(communities = communities, no = no, steps = steps) +} # nocov end + +#' Contract several vertices into a single one +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `contract.vertices()` was renamed to `contract()` to create a more +#' consistent API. +#' @inheritParams contract +#' @keywords internal +#' @export +contract.vertices <- function(graph , mapping , vertex.attr.comb = igraph_opt("vertex.attr.comb")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "contract.vertices()", "contract()") + contract(graph = graph, mapping = mapping, vertex.attr.comb = vertex.attr.comb) +} # nocov end + +#' Functions to deal with the result of network community detection +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `code.length()` was renamed to `code_len()` to create a more +#' consistent API. +#' @inheritParams code_len +#' @keywords internal +#' @export +code.length <- function(communities) { # nocov start + lifecycle::deprecate_soft("1.6.0", "code.length()", "code_len()") + code_len(communities = communities) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -118,8 +373,6 @@ #' #' @rdname communities #' @family community -#' @aliases cutat -#' is.hierarchical is_hierarchical #' print.communities plot.communities #' length.communities #' as.dendrogram.communities as.hclust.communities @@ -303,7 +556,6 @@ print.communities <- function(x, ...) { #' modularity values is calculated automatically. #' @return A `communities` object. #' -#' @aliases create.communities #' #' @family community #' @export @@ -458,7 +710,6 @@ modularity.communities <- function(x, ...) { } #' @rdname modularity.igraph -#' @aliases mod.matrix #' @export modularity_matrix <- function(graph, membership, weights = NULL, resolution = 1, directed = TRUE) { # Argument checks @@ -836,7 +1087,6 @@ community.to.membership2 <- function(merges, vcount, steps) { #' must be a vertex id, and the same energy function is used to find the #' community of the the given vertex. See also the examples below. #' -#' @aliases spinglass.community #' @param graph The input graph, can be directed but the direction of the edges #' is neglected. #' @param weights The weights of the edges. It must be a positive numeric vector, @@ -1235,7 +1485,6 @@ cluster_fluid_communities <- function(graph, no.of.communities) { #' algorithm, see Pascal Pons, Matthieu Latapy: Computing communities in large #' networks using random walks, https://arxiv.org/abs/physics/0512106 #' -#' @aliases walktrap.community #' @param graph The input graph, edge directions are ignored in directed #' graphs. #' @param weights The weights of the edges. It must be a positive numeric vector, @@ -1342,7 +1591,6 @@ cluster_walktrap <- function(graph, weights = NULL, steps = 4, #' `edge.betweeness.community` returns various information collected #' through the run of the algorithm. See the return value down here. #' -#' @aliases edge.betweenness.community #' @param graph The graph to analyze. #' @param weights The weights of the edges. It must be a positive numeric vector, #' `NULL` or `NA`. If it is `NULL` and the input graph has a @@ -1450,7 +1698,6 @@ cluster_edge_betweenness <- function(graph, weights = NULL, #' community structure in very large networks, #' http://www.arxiv.org/abs/cond-mat/0408187 for the details. #' -#' @aliases fastgreedy.community #' @param graph The input graph #' @param merges Logical scalar, whether to return the merge matrix. #' @param modularity Logical scalar, whether to return a vector containing the @@ -1554,7 +1801,6 @@ igraph.i.levc.arp <- function(externalP, externalE) { #' Newman's paper to understand why this is a good method for detecting #' community structure. #' -#' @aliases leading.eigenvector.community #' @param graph The input graph. Should be undirected as the method needs a #' symmetric matrix. #' @param steps The number of steps to take, this is actually the number of @@ -1691,7 +1937,6 @@ cluster_leading_eigen <- function(graph, steps = -1, weights = NULL, #' connected groups of nodes form a consensus on a unique label to form #' communities.} #' -#' @aliases label.propagation.community #' @param graph The input graph, should be undirected to make sense. #' @param weights The weights of the edges. It must be a positive numeric vector, #' `NULL` or `NA`. If it is `NULL` and the input graph has a @@ -1816,7 +2061,6 @@ cluster_label_prop0 <- function( #' #' This function was contributed by Tom Gregorovic. #' -#' @aliases multilevel.community #' @param graph The input graph. #' @param weights The weights of the edges. It must be a positive numeric vector, #' `NULL` or `NA`. If it is `NULL` and the input graph has a @@ -1925,7 +2169,6 @@ cluster_louvain <- function(graph, weights = NULL, resolution = 1) { #' print(modularity(fc)) #' } #' -#' @aliases optimal.community #' @param graph The input graph. Edge directions are ignored for directed #' graphs. #' @param weights The weights of the edges. It must be a positive numeric vector, @@ -1983,7 +2226,6 @@ cluster_optimal <- function(graph, weights = NULL) { #' #' Please see the details of this method in the references given below. #' -#' @aliases infomap.community #' @param graph The input graph. #' @param e.weights If not `NULL`, then a numeric vector of edge weights. #' The length must match the number of edges in the graph. By default the @@ -2087,7 +2329,6 @@ plot.communities <- function(x, y, #' @rdname plot_dendrogram.communities -#' @aliases dendPlot #' @export plot_dendrogram <- function(x, mode = igraph_opt("dend.plot.type"), ...) { UseMethod("plot_dendrogram") @@ -2503,7 +2744,6 @@ communities <- groups.communities #' unchanged, vertex attributes are combined, according to the #' `vertex.attr.comb` parameter. #' -#' @aliases contract.vertices #' @param graph The input graph, it can be directed or undirected. #' @param mapping A numeric vector that specifies the mapping. Its elements #' correspond to the vertices, and for each element the id in the new graph is @@ -2532,36 +2772,3 @@ communities <- groups.communities #' @family functions for manipulating graph structure contract <- contract_vertices_impl #' @export code.length -deprecated("code.length", code_len) -#' @export contract.vertices -deprecated("contract.vertices", contract) -#' @export cutat -deprecated("cutat", cut_at) -#' @export dendPlot -deprecated("dendPlot", plot_dendrogram) -#' @export edge.betweenness.community -deprecated("edge.betweenness.community", cluster_edge_betweenness) -#' @export fastgreedy.community -deprecated("fastgreedy.community", cluster_fast_greedy) -#' @export infomap.community -deprecated("infomap.community", cluster_infomap) -#' @export is.hierarchical -deprecated("is.hierarchical", is_hierarchical) -#' @export label.propagation.community -deprecated("label.propagation.community", cluster_label_prop) -#' @export leading.eigenvector.community -deprecated("leading.eigenvector.community", cluster_leading_eigen) -#' @export mod.matrix -deprecated("mod.matrix", modularity_matrix) -#' @export multilevel.community -deprecated("multilevel.community", cluster_louvain) -#' @export optimal.community -deprecated("optimal.community", cluster_optimal) -#' @export showtrace -deprecated("showtrace", show_trace) -#' @export spinglass.community -deprecated("spinglass.community", cluster_spinglass) -#' @export walktrap.community -deprecated("walktrap.community", cluster_walktrap) -#' @export create.communities -deprecated("create.communities", make_clusters) diff --git a/man/as_membership.Rd b/man/as_membership.Rd index fc3d64d31ca..2b93641f1b8 100644 --- a/man/as_membership.Rd +++ b/man/as_membership.Rd @@ -42,7 +42,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_edge_betweenness.Rd b/man/cluster_edge_betweenness.Rd index 991ee28ac25..6d31faa37fa 100644 --- a/man/cluster_edge_betweenness.Rd +++ b/man/cluster_edge_betweenness.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_edge_betweenness} \alias{cluster_edge_betweenness} -\alias{edge.betweenness.community} \title{Community structure detection based on edge betweenness} \usage{ cluster_edge_betweenness( @@ -125,7 +124,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_fast_greedy.Rd b/man/cluster_fast_greedy.Rd index 96ba6c2461c..28c83d5c535 100644 --- a/man/cluster_fast_greedy.Rd +++ b/man/cluster_fast_greedy.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_fast_greedy} \alias{cluster_fast_greedy} -\alias{fastgreedy.community} \title{Community structure via greedy optimization of modularity} \usage{ cluster_fast_greedy( @@ -84,7 +83,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_fluid_communities.Rd b/man/cluster_fluid_communities.Rd index cfefcfd3738..748da5782e1 100644 --- a/man/cluster_fluid_communities.Rd +++ b/man/cluster_fluid_communities.Rd @@ -63,7 +63,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_infomap.Rd b/man/cluster_infomap.Rd index c6686d98779..b00b9150d8f 100644 --- a/man/cluster_infomap.Rd +++ b/man/cluster_infomap.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_infomap} \alias{cluster_infomap} -\alias{infomap.community} \title{Infomap community finding} \usage{ cluster_infomap( @@ -83,7 +82,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_label_prop.Rd b/man/cluster_label_prop.Rd index 3f7280f7f91..3b70de75b50 100644 --- a/man/cluster_label_prop.Rd +++ b/man/cluster_label_prop.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_label_prop} \alias{cluster_label_prop} -\alias{label.propagation.community} \title{Finding communities based on propagating labels} \usage{ cluster_label_prop(graph, weights = NULL, ..., initial = NULL, fixed = NULL) @@ -87,7 +86,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_leading_eigen.Rd b/man/cluster_leading_eigen.Rd index a13c2b4f610..1dfee602db2 100644 --- a/man/cluster_leading_eigen.Rd +++ b/man/cluster_leading_eigen.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_leading_eigen} \alias{cluster_leading_eigen} -\alias{leading.eigenvector.community} \title{Community structure detecting based on the leading eigenvector of the community matrix} \usage{ @@ -137,7 +136,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_leiden.Rd b/man/cluster_leiden.Rd index dc97b8b91a4..de8f1dfe604 100644 --- a/man/cluster_leiden.Rd +++ b/man/cluster_leiden.Rd @@ -145,7 +145,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_louvain.Rd b/man/cluster_louvain.Rd index 8a746e3dcee..97be08be2c8 100644 --- a/man/cluster_louvain.Rd +++ b/man/cluster_louvain.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_louvain} \alias{cluster_louvain} -\alias{multilevel.community} \title{Finding community structure by multi-level optimization of modularity} \usage{ cluster_louvain(graph, weights = NULL, resolution = 1) @@ -91,7 +90,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_optimal.Rd b/man/cluster_optimal.Rd index a5b9e5cb37d..f0f9c3a9177 100644 --- a/man/cluster_optimal.Rd +++ b/man/cluster_optimal.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_optimal} \alias{cluster_optimal} -\alias{optimal.community} \title{Optimal community structure} \usage{ cluster_optimal(graph, weights = NULL) @@ -90,7 +89,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_spinglass.Rd b/man/cluster_spinglass.Rd index 44fd509e165..bcf6d9576d6 100644 --- a/man/cluster_spinglass.Rd +++ b/man/cluster_spinglass.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_spinglass} \alias{cluster_spinglass} -\alias{spinglass.community} \title{Finding communities in graphs based on statistical meachanics} \usage{ cluster_spinglass( @@ -161,7 +160,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/cluster_walktrap.Rd b/man/cluster_walktrap.Rd index 99d51a045f4..e2940e4ca5c 100644 --- a/man/cluster_walktrap.Rd +++ b/man/cluster_walktrap.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{cluster_walktrap} \alias{cluster_walktrap} -\alias{walktrap.community} \title{Community structure via short random walks} \usage{ cluster_walktrap( @@ -90,7 +89,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/code.length.Rd b/man/code.length.Rd new file mode 100644 index 00000000000..be96cd67b3e --- /dev/null +++ b/man/code.length.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{code.length} +\alias{code.length} +\title{Functions to deal with the result of network community detection} +\usage{ +code.length(communities) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{code.length()} was renamed to \code{code_len()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/communities.Rd b/man/communities.Rd index d9975f7f09e..183ad2b7519 100644 --- a/man/communities.Rd +++ b/man/communities.Rd @@ -2,24 +2,20 @@ % Please edit documentation in R/community.R \name{membership} \alias{membership} -\alias{cutat} -\alias{is.hierarchical} -\alias{is_hierarchical} \alias{print.communities} -\alias{plot.communities} -\alias{length.communities} -\alias{as.dendrogram.communities} -\alias{as.hclust.communities} -\alias{showtrace} -\alias{code.length} \alias{modularity.communities} +\alias{length.communities} \alias{sizes} \alias{algorithm} \alias{merges} \alias{crossing} \alias{code_len} +\alias{is_hierarchical} +\alias{as.dendrogram.communities} +\alias{as.hclust.communities} \alias{cut_at} \alias{show_trace} +\alias{plot.communities} \alias{communities} \title{Functions to deal with the result of network community detection} \usage{ @@ -257,29 +253,13 @@ dendrograms. See \code{\link[=compare]{compare()}} for comparing two community structures on the same graph. - -Community detection -\code{\link{as_membership}()}, -\code{\link{cluster_edge_betweenness}()}, -\code{\link{cluster_fast_greedy}()}, -\code{\link{cluster_fluid_communities}()}, -\code{\link{cluster_infomap}()}, -\code{\link{cluster_label_prop}()}, -\code{\link{cluster_leading_eigen}()}, -\code{\link{cluster_leiden}()}, -\code{\link{cluster_louvain}()}, -\code{\link{cluster_optimal}()}, -\code{\link{cluster_spinglass}()}, -\code{\link{cluster_walktrap}()}, -\code{\link{compare}()}, -\code{\link{groups}()}, -\code{\link{make_clusters}()}, -\code{\link{modularity.igraph}()}, -\code{\link{plot_dendrogram}()}, -\code{\link{split_join_distance}()} } \author{ Gabor Csardi \email{csardi.gabor@gmail.com} } -\concept{community} +\concept{community +print.communities plot.communities +length.communities +as.dendrogram.communities as.hclust.communities +showtrace code.length} \keyword{graphs} diff --git a/man/compare.Rd b/man/compare.Rd index be522b0adb3..1b0f116da4f 100644 --- a/man/compare.Rd +++ b/man/compare.Rd @@ -81,7 +81,6 @@ Community detection \code{\link{cluster_walktrap}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/contract.Rd b/man/contract.Rd index 91c22c2af77..0001c399b21 100644 --- a/man/contract.Rd +++ b/man/contract.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{contract} \alias{contract} -\alias{contract.vertices} \title{Contract several vertices into a single one} \usage{ contract(graph, mapping, vertex.attr.comb = igraph_opt("vertex.attr.comb")) diff --git a/man/contract.vertices.Rd b/man/contract.vertices.Rd new file mode 100644 index 00000000000..da5f8eeb381 --- /dev/null +++ b/man/contract.vertices.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{contract.vertices} +\alias{contract.vertices} +\title{Contract several vertices into a single one} +\usage{ +contract.vertices( + graph, + mapping, + vertex.attr.comb = igraph_opt("vertex.attr.comb") +) +} +\arguments{ +\item{graph}{The input graph, it can be directed or undirected.} + +\item{mapping}{A numeric vector that specifies the mapping. Its elements +correspond to the vertices, and for each element the id in the new graph is +given.} + +\item{vertex.attr.comb}{Specifies how to combine the vertex attributes in +the new graph. Please see \code{\link[=attribute.combination]{attribute.combination()}} for details.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{contract.vertices()} was renamed to \code{contract()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/create.communities.Rd b/man/create.communities.Rd new file mode 100644 index 00000000000..a5a295fba5c --- /dev/null +++ b/man/create.communities.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{create.communities} +\alias{create.communities} +\title{Creates a communities object.} +\usage{ +create.communities( + graph, + membership = NULL, + algorithm = NULL, + merges = NULL, + modularity = TRUE +) +} +\arguments{ +\item{graph}{The graph of the community structure.} + +\item{membership}{The membership vector of the community structure, a +numeric vector denoting the id of the community for each vertex. It +might be \code{NULL} for hierarchical community structures.} + +\item{algorithm}{Character string, the algorithm that generated +the community structure, it can be arbitrary.} + +\item{merges}{A merge matrix, for hierarchical community structures (or +\code{NULL} otherwise.} + +\item{modularity}{Modularity value of the community structure. If this +is \code{TRUE} and the membership vector is available, then it the +modularity values is calculated automatically.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{create.communities()} was renamed to \code{make_clusters()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/cutat.Rd b/man/cutat.Rd new file mode 100644 index 00000000000..76ddf29d58b --- /dev/null +++ b/man/cutat.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{cutat} +\alias{cutat} +\title{Functions to deal with the result of network community detection} +\usage{ +cutat(communities, no, steps) +} +\arguments{ +\item{no}{Integer scalar, the desired number of communities. If too low or +two high, then an error message is given. Exactly one of \code{no} and +\code{steps} must be supplied.} + +\item{steps}{The number of merge operations to perform to produce the +communities. Exactly one of \code{no} and \code{steps} must be supplied.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{cutat()} was renamed to \code{cut_at()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/dendPlot.Rd b/man/dendPlot.Rd new file mode 100644 index 00000000000..63f2e7940a7 --- /dev/null +++ b/man/dendPlot.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{dendPlot} +\alias{dendPlot} +\title{Community structure dendrogram plots} +\usage{ +dendPlot(x, mode = igraph_opt("dend.plot.type"), ...) +} +\arguments{ +\item{x}{An object containing the community structure of a graph. See +\code{\link[=communities]{communities()}} for details.} + +\item{mode}{Which dendrogram plotting function to use. See details below.} + +\item{...}{Additional arguments to supply to the dendrogram plotting +function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{dendPlot()} was renamed to \code{plot_dendrogram()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/edge.betweenness.community.Rd b/man/edge.betweenness.community.Rd new file mode 100644 index 00000000000..8c0bf1cfeba --- /dev/null +++ b/man/edge.betweenness.community.Rd @@ -0,0 +1,65 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{edge.betweenness.community} +\alias{edge.betweenness.community} +\title{Community structure detection based on edge betweenness} +\usage{ +edge.betweenness.community( + graph, + weights = NULL, + directed = TRUE, + edge.betweenness = TRUE, + merges = TRUE, + bridges = TRUE, + modularity = TRUE, + membership = TRUE +) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. Edge weights +are used to calculate weighted edge betweenness. This means that edges are +interpreted as distances, not as connection strengths.} + +\item{directed}{Logical constant, whether to calculate directed edge +betweenness for directed graphs. It is ignored for undirected graphs.} + +\item{edge.betweenness}{Logical constant, whether to return the edge +betweenness of the edges at the time of their removal.} + +\item{merges}{Logical constant, whether to return the merge matrix +representing the hierarchical community structure of the network. This +argument is called \code{merges}, even if the community structure algorithm +itself is divisive and not agglomerative: it builds the tree from top to +bottom. There is one line for each merge (i.e. split) in matrix, the first +line is the first merge (last split). The communities are identified by +integer number starting from one. Community ids smaller than or equal to +\eqn{N}, the number of vertices in the graph, belong to singleton +communities, i.e. individual vertices. Before the first merge we have \eqn{N} +communities numbered from one to \eqn{N}. The first merge, the first line of +the matrix creates community \eqn{N+1}, the second merge creates community +\eqn{N+2}, etc.} + +\item{bridges}{Logical constant, whether to return a list the edge removals +which actually splitted a component of the graph.} + +\item{modularity}{Logical constant, whether to calculate the maximum +modularity score, considering all possibly community structures along the +edge-betweenness based edge removals.} + +\item{membership}{Logical constant, whether to calculate the membership +vector corresponding to the highest possible modularity score.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{edge.betweenness.community()} was renamed to \code{cluster_edge_betweenness()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/fastgreedy.community.Rd b/man/fastgreedy.community.Rd new file mode 100644 index 00000000000..ab36b5f172e --- /dev/null +++ b/man/fastgreedy.community.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{fastgreedy.community} +\alias{fastgreedy.community} +\title{Community structure via greedy optimization of modularity} +\usage{ +fastgreedy.community( + graph, + merges = TRUE, + modularity = TRUE, + membership = TRUE, + weights = NULL +) +} +\arguments{ +\item{graph}{The input graph} + +\item{merges}{Logical scalar, whether to return the merge matrix.} + +\item{modularity}{Logical scalar, whether to return a vector containing the +modularity after each merge.} + +\item{membership}{Logical scalar, whether to calculate the membership vector +corresponding to the maximum modularity score, considering all possible +community structures along the merges.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{fastgreedy.community()} was renamed to \code{cluster_fast_greedy()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/groups.Rd b/man/groups.Rd index a72ac54bb81..36a2f317092 100644 --- a/man/groups.Rd +++ b/man/groups.Rd @@ -55,7 +55,6 @@ Community detection \code{\link{cluster_walktrap}()}, \code{\link{compare}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/infomap.community.Rd b/man/infomap.community.Rd new file mode 100644 index 00000000000..ad91b0419e0 --- /dev/null +++ b/man/infomap.community.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{infomap.community} +\alias{infomap.community} +\title{Infomap community finding} +\usage{ +infomap.community( + graph, + e.weights = NULL, + v.weights = NULL, + nb.trials = 10, + modularity = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{e.weights}{If not \code{NULL}, then a numeric vector of edge weights. +The length must match the number of edges in the graph. By default the +\sQuote{\code{weight}} edge attribute is used as weights. If it is not +present, then all edges are considered to have the same weight. +Larger edge weights correspond to stronger connections.} + +\item{v.weights}{If not \code{NULL}, then a numeric vector of vertex +weights. The length must match the number of vertices in the graph. By +default the \sQuote{\code{weight}} vertex attribute is used as weights. If +it is not present, then all vertices are considered to have the same weight. +A larger vertex weight means a larger probability that the random surfer +jumps to that vertex.} + +\item{nb.trials}{The number of attempts to partition the network (can be any +integer value equal or larger than 1).} + +\item{modularity}{Logical scalar, whether to calculate the modularity score +of the detected community structure.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{infomap.community()} was renamed to \code{cluster_infomap()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.hierarchical.Rd b/man/is.hierarchical.Rd new file mode 100644 index 00000000000..585e656a36c --- /dev/null +++ b/man/is.hierarchical.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{is.hierarchical} +\alias{is.hierarchical} +\title{Functions to deal with the result of network community detection} +\usage{ +is.hierarchical(communities) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.hierarchical()} was renamed to \code{is_hierarchical()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/label.propagation.community.Rd b/man/label.propagation.community.Rd new file mode 100644 index 00000000000..e92f653d50f --- /dev/null +++ b/man/label.propagation.community.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{label.propagation.community} +\alias{label.propagation.community} +\title{Finding communities based on propagating labels} +\usage{ +label.propagation.community( + graph, + weights = NULL, + ..., + initial = NULL, + fixed = NULL +) +} +\arguments{ +\item{graph}{The input graph, should be undirected to make sense.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} + +\item{...}{These dots are for future extensions and must be empty.} + +\item{initial}{The initial state. If \code{NULL}, every vertex will have a +different label at the beginning. Otherwise it must be a vector with an +entry for each vertex. Non-negative values denote different labels, negative +entries denote vertices without labels.} + +\item{fixed}{Logical vector denoting which labels are fixed. Of course this +makes sense only if you provided an initial state, otherwise this element +will be ignored. Also note that vertices without labels cannot be fixed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{label.propagation.community()} was renamed to \code{cluster_label_prop()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/leading.eigenvector.community.Rd b/man/leading.eigenvector.community.Rd new file mode 100644 index 00000000000..c35aa58bd14 --- /dev/null +++ b/man/leading.eigenvector.community.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{leading.eigenvector.community} +\alias{leading.eigenvector.community} +\title{Community structure detecting based on the leading eigenvector of the community matrix} +\usage{ +leading.eigenvector.community( + graph, + steps = -1, + weights = NULL, + start = NULL, + options = arpack_defaults(), + callback = NULL, + extra = NULL, + env = parent.frame() +) +} +\arguments{ +\item{graph}{The input graph. Should be undirected as the method needs a +symmetric matrix.} + +\item{steps}{The number of steps to take, this is actually the number of +tries to make a step. It is not a particularly useful parameter.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} + +\item{start}{\code{NULL}, or a numeric membership vector, giving the start +configuration of the algorithm.} + +\item{options}{A named list to override some ARPACK options.} + +\item{callback}{If not \code{NULL}, then it must be callback function. This +is called after each iteration, after calculating the leading eigenvector of +the modularity matrix. See details below.} + +\item{extra}{Additional argument to supply to the callback function.} + +\item{env}{The environment in which the callback function is evaluated.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{leading.eigenvector.community()} was renamed to \code{cluster_leading_eigen()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/make_clusters.Rd b/man/make_clusters.Rd index 2d43b04272d..944eecc783d 100644 --- a/man/make_clusters.Rd +++ b/man/make_clusters.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{make_clusters} \alias{make_clusters} -\alias{create.communities} \title{Creates a communities object.} \usage{ make_clusters( @@ -53,7 +52,6 @@ Community detection \code{\link{cluster_walktrap}()}, \code{\link{compare}()}, \code{\link{groups}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} diff --git a/man/mod.matrix.Rd b/man/mod.matrix.Rd new file mode 100644 index 00000000000..073cdaec478 --- /dev/null +++ b/man/mod.matrix.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{mod.matrix} +\alias{mod.matrix} +\title{Modularity of a community structure of a graph} +\usage{ +mod.matrix(graph, membership, weights = NULL, resolution = 1, directed = TRUE) +} +\arguments{ +\item{membership}{Numeric vector, one value for each vertex, the membership +vector of the community structure.} + +\item{weights}{If not \code{NULL} then a numeric vector giving edge weights.} + +\item{resolution}{The resolution parameter. Must be greater than or equal to +0. Set it to 1 to use the classical definition of modularity.} + +\item{directed}{Whether to use the directed or undirected version of +modularity. Ignored for undirected graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{mod.matrix()} was renamed to \code{modularity_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/modularity.igraph.Rd b/man/modularity.igraph.Rd index e58073e57a8..7cd224ba802 100644 --- a/man/modularity.igraph.Rd +++ b/man/modularity.igraph.Rd @@ -4,7 +4,6 @@ \alias{modularity.igraph} \alias{modularity} \alias{modularity_matrix} -\alias{mod.matrix} \title{Modularity of a community structure of a graph} \usage{ \method{modularity}{igraph}(x, membership, weights = NULL, resolution = 1, directed = TRUE, ...) @@ -120,7 +119,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{plot_dendrogram}()}, \code{\link{split_join_distance}()} } diff --git a/man/multilevel.community.Rd b/man/multilevel.community.Rd new file mode 100644 index 00000000000..132f0442986 --- /dev/null +++ b/man/multilevel.community.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{multilevel.community} +\alias{multilevel.community} +\title{Finding community structure by multi-level optimization of modularity} +\usage{ +multilevel.community(graph, weights = NULL, resolution = 1) +} +\arguments{ +\item{graph}{The input graph.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} + +\item{resolution}{Optional resolution parameter that allows the user to +adjust the resolution parameter of the modularity function that the algorithm +uses internally. Lower values typically yield fewer, larger clusters. The +original definition of modularity is recovered when the resolution parameter +is set to 1.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{multilevel.community()} was renamed to \code{cluster_louvain()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/optimal.community.Rd b/man/optimal.community.Rd new file mode 100644 index 00000000000..91285a08265 --- /dev/null +++ b/man/optimal.community.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{optimal.community} +\alias{optimal.community} +\title{Optimal community structure} +\usage{ +optimal.community(graph, weights = NULL) +} +\arguments{ +\item{graph}{The input graph. Edge directions are ignored for directed +graphs.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{optimal.community()} was renamed to \code{cluster_optimal()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/plot_dendrogram.communities.Rd b/man/plot_dendrogram.communities.Rd index de6953aed79..908e07fb7b2 100644 --- a/man/plot_dendrogram.communities.Rd +++ b/man/plot_dendrogram.communities.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/community.R \name{plot_dendrogram} \alias{plot_dendrogram} -\alias{dendPlot} \alias{plot_dendrogram.communities} \title{Community structure dendrogram plots} \usage{ @@ -117,7 +116,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{split_join_distance}()} } diff --git a/man/showtrace.Rd b/man/showtrace.Rd new file mode 100644 index 00000000000..79146916310 --- /dev/null +++ b/man/showtrace.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{showtrace} +\alias{showtrace} +\title{Functions to deal with the result of network community detection} +\usage{ +showtrace(communities) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{showtrace()} was renamed to \code{show_trace()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/spinglass.community.Rd b/man/spinglass.community.Rd new file mode 100644 index 00000000000..055e2a2a4dd --- /dev/null +++ b/man/spinglass.community.Rd @@ -0,0 +1,94 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{spinglass.community} +\alias{spinglass.community} +\title{Finding communities in graphs based on statistical meachanics} +\usage{ +spinglass.community( + graph, + weights = NULL, + vertex = NULL, + spins = 25, + parupdate = FALSE, + start.temp = 1, + stop.temp = 0.01, + cool.fact = 0.99, + update.rule = c("config", "random", "simple"), + gamma = 1, + implementation = c("orig", "neg"), + gamma.minus = 1 +) +} +\arguments{ +\item{graph}{The input graph, can be directed but the direction of the edges +is neglected.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. A larger +edge weight means a stronger connection for this function.} + +\item{vertex}{This parameter can be used to calculate the community of a +given vertex without calculating all communities. Note that if this argument +is present then some other arguments are ignored.} + +\item{spins}{Integer constant, the number of spins to use. This is the upper +limit for the number of communities. It is not a problem to supply a +(reasonably) big number here, in which case some spin states will be +unpopulated.} + +\item{parupdate}{Logical constant, whether to update the spins of the +vertices in parallel (synchronously) or not. This argument is ignored if the +second form of the function is used (i.e. the \sQuote{\code{vertex}} argument +is present). It is also not implemented in the \dQuote{neg} implementation.} + +\item{start.temp}{Real constant, the start temperature. This argument is +ignored if the second form of the function is used (i.e. the +\sQuote{\code{vertex}} argument is present).} + +\item{stop.temp}{Real constant, the stop temperature. The simulation +terminates if the temperature lowers below this level. This argument is +ignored if the second form of the function is used (i.e. the +\sQuote{\code{vertex}} argument is present).} + +\item{cool.fact}{Cooling factor for the simulated annealing. This argument +is ignored if the second form of the function is used (i.e. the +\sQuote{\code{vertex}} argument is present).} + +\item{update.rule}{Character constant giving the \sQuote{null-model} of the +simulation. Possible values: \dQuote{simple} and \dQuote{config}. +\dQuote{simple} uses a random graph with the same number of edges as the +baseline probability and \dQuote{config} uses a random graph with the same +vertex degrees as the input graph.} + +\item{gamma}{Real constant, the gamma argument of the algorithm. This +specifies the balance between the importance of present and non-present +edges in a community. Roughly, a comunity is a set of vertices having many +edges inside the community and few edges outside the community. The default +1.0 value makes existing and non-existing links equally important. Smaller +values make the existing links, greater values the missing links more +important.} + +\item{implementation}{Character scalar. Currently igraph contains two +implementations for the Spin-glass community finding algorithm. The faster +original implementation is the default. The other implementation, that takes +into account negative weights, can be chosen by supplying \sQuote{neg} here.} + +\item{gamma.minus}{Real constant, the gamma.minus parameter of the +algorithm. This specifies the balance between the importance of present and +non-present negative weighted edges in a community. Smaller values of +gamma.minus, leads to communities with lesser negative intra-connectivity. +If this argument is set to zero, the algorithm reduces to a graph coloring +algorithm, using the number of spins as the number of colors. This argument +is ignored if the \sQuote{orig} implementation is chosen.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{spinglass.community()} was renamed to \code{cluster_spinglass()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/split_join_distance.Rd b/man/split_join_distance.Rd index 241059882b1..35afa402751 100644 --- a/man/split_join_distance.Rd +++ b/man/split_join_distance.Rd @@ -58,7 +58,6 @@ Community detection \code{\link{compare}()}, \code{\link{groups}()}, \code{\link{make_clusters}()}, -\code{\link{membership}()}, \code{\link{modularity.igraph}()}, \code{\link{plot_dendrogram}()} } diff --git a/man/walktrap.community.Rd b/man/walktrap.community.Rd new file mode 100644 index 00000000000..b428fa705cc --- /dev/null +++ b/man/walktrap.community.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/community.R +\name{walktrap.community} +\alias{walktrap.community} +\title{Community structure via short random walks} +\usage{ +walktrap.community( + graph, + weights = NULL, + steps = 4, + merges = TRUE, + modularity = TRUE, + membership = TRUE +) +} +\arguments{ +\item{graph}{The input graph, edge directions are ignored in directed +graphs.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for community detection. Larger edge +weights increase the probability that an edge is selected by the random +walker. In other words, larger edge weights correspond to stronger connections.} + +\item{steps}{The length of the random walks to perform.} + +\item{merges}{Logical scalar, whether to include the merge matrix in the +result.} + +\item{modularity}{Logical scalar, whether to include the vector of the +modularity scores in the result. If the \code{membership} argument is true, +then it will always be calculated.} + +\item{membership}{Logical scalar, whether to calculate the membership vector +for the split corresponding to the highest modularity value.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{walktrap.community()} was renamed to \code{cluster_walktrap()} to create a more +consistent API. +} +\keyword{internal} From 60997a3adadf906ce3e0873d07e610a3988a885b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:56:30 +0100 Subject: [PATCH 14/48] refactor!: change R/components.R --- R/components.R | 87 ++++++++++++++++++++++++++++++----- man/articulation.points.Rd | 19 ++++++++ man/articulation_points.Rd | 1 - man/biconnected.components.Rd | 19 ++++++++ man/biconnected_components.Rd | 1 - man/cluster.distribution.Rd | 27 +++++++++++ man/decompose.Rd | 1 - man/decompose.graph.Rd | 37 +++++++++++++++ man/no.clusters.Rd | 22 +++++++++ 9 files changed, 199 insertions(+), 15 deletions(-) create mode 100644 man/articulation.points.Rd create mode 100644 man/biconnected.components.Rd create mode 100644 man/cluster.distribution.Rd create mode 100644 man/decompose.graph.Rd create mode 100644 man/no.clusters.Rd diff --git a/R/components.R b/R/components.R index bd73ded2033..59382269026 100644 --- a/R/components.R +++ b/R/components.R @@ -1,3 +1,78 @@ + +#' Connected components of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `no.clusters()` was renamed to `count_components()` to create a more +#' consistent API. +#' @inheritParams count_components +#' @keywords internal +#' @export +no.clusters <- function(graph , mode = c("weak","strong")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "no.clusters()", "count_components()") + count_components(graph = graph, mode = mode) +} # nocov end + +#' Decompose a graph into components +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `decompose.graph()` was renamed to `decompose()` to create a more +#' consistent API. +#' @inheritParams decompose +#' @keywords internal +#' @export +decompose.graph <- function(graph , mode = c("weak","strong") , max.comps = NA , min.vertices = 0) { # nocov start + lifecycle::deprecate_soft("1.6.0", "decompose.graph()", "decompose()") + decompose(graph = graph, mode = mode, max.comps = max.comps, min.vertices = min.vertices) +} # nocov end + +#' Connected components of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `cluster.distribution()` was renamed to `component_distribution()` to create a more +#' consistent API. +#' @inheritParams component_distribution +#' @keywords internal +#' @export +cluster.distribution <- function(graph , cumulative = FALSE , mul.size = FALSE , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "cluster.distribution()", "component_distribution()") + component_distribution(graph = graph, cumulative = cumulative, mul.size = mul.size, ...) +} # nocov end + +#' Biconnected components +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `biconnected.components()` was renamed to `biconnected_components()` to create a more +#' consistent API. +#' @inheritParams biconnected_components +#' @keywords internal +#' @export +biconnected.components <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "biconnected.components()", "biconnected_components()") + biconnected_components(graph = graph) +} # nocov end + +#' Articulation points and bridges of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `articulation.points()` was renamed to `articulation_points()` to create a more +#' consistent API. +#' @inheritParams articulation_points +#' @keywords internal +#' @export +articulation.points <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "articulation.points()", "articulation_points()") + articulation_points(graph = graph) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -70,7 +145,6 @@ component_distribution <- function(graph, cumulative = FALSE, mul.size = FALSE, #' #' Creates a separate graph for each connected component of a graph. #' -#' @aliases decompose.graph #' @param graph The original graph. #' @param mode Character constant giving the type of the components, wither #' `weak` for weakly connected components or `strong` for strongly @@ -131,7 +205,6 @@ decompose <- function(graph, mode = c("weak", "strong"), max.comps = NA, # " two. If a graph contains no bridges, then its edge connectivity is at least #' two. #' -#' @aliases articulation.points #' @param graph The input graph. It is treated as an undirected graph, even if #' it is directed. #' @return For `articulation_points()`, a numeric vector giving the vertex @@ -175,7 +248,6 @@ bridges <- bridges_impl #' that this is not true for vertices: the same vertex can be part of many #' biconnected components. #' -#' @aliases biconnected.components #' @param graph The input graph. It is treated as an undirected graph, even if #' it is directed. #' @return A named list with three components: \item{no}{Numeric scalar, an @@ -217,12 +289,3 @@ largest_component <- function(graph, mode = c("weak", "strong")) { induced_subgraph(graph, vids) } #' @export articulation.points -deprecated("articulation.points", articulation_points) -#' @export biconnected.components -deprecated("biconnected.components", biconnected_components) -#' @export cluster.distribution -deprecated("cluster.distribution", component_distribution) -#' @export decompose.graph -deprecated("decompose.graph", decompose) -#' @export no.clusters -deprecated("no.clusters", count_components) diff --git a/man/articulation.points.Rd b/man/articulation.points.Rd new file mode 100644 index 00000000000..87641c892a1 --- /dev/null +++ b/man/articulation.points.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{articulation.points} +\alias{articulation.points} +\title{Articulation points and bridges of a graph} +\usage{ +articulation.points(graph) +} +\arguments{ +\item{graph}{The input graph. It is treated as an undirected graph, even if +it is directed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{articulation.points()} was renamed to \code{articulation_points()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/articulation_points.Rd b/man/articulation_points.Rd index 3b65008811e..b24c959b377 100644 --- a/man/articulation_points.Rd +++ b/man/articulation_points.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/components.R \name{articulation_points} \alias{articulation_points} -\alias{articulation.points} \alias{bridges} \title{Articulation points and bridges of a graph} \usage{ diff --git a/man/biconnected.components.Rd b/man/biconnected.components.Rd new file mode 100644 index 00000000000..4e5f79237d4 --- /dev/null +++ b/man/biconnected.components.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{biconnected.components} +\alias{biconnected.components} +\title{Biconnected components} +\usage{ +biconnected.components(graph) +} +\arguments{ +\item{graph}{The input graph. It is treated as an undirected graph, even if +it is directed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{biconnected.components()} was renamed to \code{biconnected_components()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/biconnected_components.Rd b/man/biconnected_components.Rd index 3fe8dd30160..52d920575e0 100644 --- a/man/biconnected_components.Rd +++ b/man/biconnected_components.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/components.R \name{biconnected_components} \alias{biconnected_components} -\alias{biconnected.components} \title{Biconnected components} \usage{ biconnected_components(graph) diff --git a/man/cluster.distribution.Rd b/man/cluster.distribution.Rd new file mode 100644 index 00000000000..52a18013276 --- /dev/null +++ b/man/cluster.distribution.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{cluster.distribution} +\alias{cluster.distribution} +\title{Connected components of a graph} +\usage{ +cluster.distribution(graph, cumulative = FALSE, mul.size = FALSE, ...) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{cumulative}{Logical, if TRUE the cumulative distirubution (relative +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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{cluster.distribution()} was renamed to \code{component_distribution()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/decompose.Rd b/man/decompose.Rd index 4f5b71a884a..f2fb8264e7d 100644 --- a/man/decompose.Rd +++ b/man/decompose.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/components.R \name{decompose} \alias{decompose} -\alias{decompose.graph} \title{Decompose a graph into components} \usage{ decompose(graph, mode = c("weak", "strong"), max.comps = NA, min.vertices = 0) diff --git a/man/decompose.graph.Rd b/man/decompose.graph.Rd new file mode 100644 index 00000000000..2d0da7dde12 --- /dev/null +++ b/man/decompose.graph.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{decompose.graph} +\alias{decompose.graph} +\title{Decompose a graph into components} +\usage{ +decompose.graph( + graph, + mode = c("weak", "strong"), + max.comps = NA, + min.vertices = 0 +) +} +\arguments{ +\item{graph}{The original graph.} + +\item{mode}{Character constant giving the type of the components, wither +\code{weak} for weakly connected components or \code{strong} for strongly +connected components.} + +\item{max.comps}{The maximum number of components to return. The first +\code{max.comps} components will be returned (which hold at least +\code{min.vertices} vertices, see the next parameter), the others will be +ignored. Supply \code{NA} here if you don't want to limit the number of +components.} + +\item{min.vertices}{The minimum number of vertices a component should +contain in order to place it in the result list. E.g. supply 2 here to ignore +isolate vertices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{decompose.graph()} was renamed to \code{decompose()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/no.clusters.Rd b/man/no.clusters.Rd new file mode 100644 index 00000000000..598b20de688 --- /dev/null +++ b/man/no.clusters.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/components.R +\name{no.clusters} +\alias{no.clusters} +\title{Connected components of a graph} +\usage{ +no.clusters(graph, mode = c("weak", "strong")) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{no.clusters()} was renamed to \code{count_components()} to create a more +consistent API. +} +\keyword{internal} From b6bd580bd9647a99e0a736a480b2024c88a3c951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:57:01 +0100 Subject: [PATCH 15/48] refactor!: change R/console.R --- R/console.R | 17 +++++++++++++++-- man/console.Rd | 1 - man/igraph.console.Rd | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 man/igraph.console.Rd diff --git a/R/console.R b/R/console.R index f5beb7b8b26..727e6cf42ec 100644 --- a/R/console.R +++ b/R/console.R @@ -1,4 +1,19 @@ +#' The igraph console +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.console()` was renamed to `console()` to create a more +#' consistent API. +#' +#' @keywords internal +#' @export +igraph.console <- function() { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.console()", "console()") + console() +} # nocov end + # IGraph R package # Copyright (C) 2010-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -36,7 +51,6 @@ #' #' The console is written in Tcl/Tk and required the `tcltk` package. #' -#' @aliases igraph.console #' @return `NULL`, invisibly. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @seealso [igraph_options()] and the `verbose` option. @@ -282,4 +296,3 @@ close.igraphconsole <- function(con, ...) { list(frame = frame, pb = pb) } #' @export igraph.console -deprecated("igraph.console", console) diff --git a/man/console.Rd b/man/console.Rd index 76696a09a3f..4ae2d543bff 100644 --- a/man/console.Rd +++ b/man/console.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/console.R \name{console} \alias{console} -\alias{igraph.console} \alias{.igraph.progress} \alias{.igraph.status} \title{The igraph console} diff --git a/man/igraph.console.Rd b/man/igraph.console.Rd new file mode 100644 index 00000000000..6b526fbe872 --- /dev/null +++ b/man/igraph.console.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/console.R +\name{igraph.console} +\alias{igraph.console} +\title{The igraph console} +\usage{ +igraph.console() +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.console()} was renamed to \code{console()} to create a more +consistent API. +} +\keyword{internal} From bff9ec2c6f86c3c33ad06b382fc66420337d237f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:57:32 +0100 Subject: [PATCH 16/48] refactor!: change R/conversion.R --- R/conversion.R | 160 +++++++++++++++++++++++++++++------ man/as_adj_list.Rd | 2 - man/as_adjacency_matrix.Rd | 1 - man/as_biadjacency_matrix.Rd | 1 - man/as_edgelist.Rd | 1 - man/as_graphnel.Rd | 1 - man/get.adjacency.Rd | 55 ++++++++++++ man/get.adjedgelist.Rd | 31 +++++++ man/get.adjlist.Rd | 35 ++++++++ man/get.data.frame.Rd | 21 +++++ man/get.edgelist.Rd | 22 +++++ man/get.incidence.Rd | 38 +++++++++ man/graph.adjlist.Rd | 33 ++++++++ man/graph_from_adj_list.Rd | 1 - man/graph_from_graphnel.Rd | 1 - man/igraph.from.graphNEL.Rd | 30 +++++++ man/igraph.to.graphNEL.Rd | 18 ++++ 17 files changed, 418 insertions(+), 33 deletions(-) create mode 100644 man/get.adjacency.Rd create mode 100644 man/get.adjedgelist.Rd create mode 100644 man/get.adjlist.Rd create mode 100644 man/get.data.frame.Rd create mode 100644 man/get.edgelist.Rd create mode 100644 man/get.incidence.Rd create mode 100644 man/graph.adjlist.Rd create mode 100644 man/igraph.from.graphNEL.Rd create mode 100644 man/igraph.to.graphNEL.Rd diff --git a/R/conversion.R b/R/conversion.R index e553dedd5bb..3e55753d7ba 100644 --- a/R/conversion.R +++ b/R/conversion.R @@ -1,3 +1,138 @@ + +#' Convert igraph graphs to graphNEL objects from the graph package +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.to.graphNEL()` was renamed to `as_graphnel()` to create a more +#' consistent API. +#' @inheritParams as_graphnel +#' @keywords internal +#' @export +igraph.to.graphNEL <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.to.graphNEL()", "as_graphnel()") + as_graphnel(graph = graph) +} # nocov end + +#' Convert graphNEL objects from the graph package to igraph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.from.graphNEL()` was renamed to `graph_from_graphnel()` to create a more +#' consistent API. +#' @inheritParams graph_from_graphnel +#' @keywords internal +#' @export +igraph.from.graphNEL <- function(graphNEL , name = TRUE , weight = TRUE , unlist.attrs = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.from.graphNEL()", "graph_from_graphnel()") + graph_from_graphnel(graphNEL = graphNEL, name = name, weight = weight, unlist.attrs = unlist.attrs) +} # nocov end + +#' Create graphs from adjacency lists +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.adjlist()` was renamed to `graph_from_adj_list()` to create a more +#' consistent API. +#' @inheritParams graph_from_adj_list +#' @keywords internal +#' @export +graph.adjlist <- function(adjlist , mode = c("out","in","all","total") , duplicate = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.adjlist()", "graph_from_adj_list()") + graph_from_adj_list(adjlist = adjlist, mode = mode, duplicate = duplicate) +} # nocov end + +#' Bipartite adjacency matrix of a bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.incidence()` was renamed to `as_biadjacency_matrix()` to create a more +#' consistent API. +#' @inheritParams as_biadjacency_matrix +#' @keywords internal +#' @export +get.incidence <- function(graph , types = NULL , attr = NULL , names = TRUE , sparse = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.incidence()", "as_biadjacency_matrix()") + as_biadjacency_matrix(graph = graph, types = types, attr = attr, names = names, sparse = sparse) +} # nocov end + +#' Convert a graph to an edge list +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.edgelist()` was renamed to `as_edgelist()` to create a more +#' consistent API. +#' @inheritParams as_edgelist +#' @keywords internal +#' @export +get.edgelist <- function(graph , names = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.edgelist()", "as_edgelist()") + as_edgelist(graph = graph, names = names) +} # nocov end + +#' Creating igraph graphs from data frames or vice-versa +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.data.frame()` was renamed to `as_data_frame()` to create a more +#' consistent API. +#' @inheritParams as_data_frame +#' @keywords internal +#' @export +get.data.frame <- function(x , what = c("edges","vertices","both")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.data.frame()", "as_data_frame()") + as_data_frame(x = x, what = what) +} # nocov end + +#' Convert a graph to an adjacency matrix +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.adjacency()` was renamed to `as_adjacency_matrix()` to create a more +#' consistent API. +#' @inheritParams as_adjacency_matrix +#' @keywords internal +#' @export +get.adjacency <- function(graph , type = c("both","upper","lower") , attr = NULL , edges = FALSE , names = TRUE , sparse = igraph_opt("sparsematrices")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.adjacency()", "as_adjacency_matrix()") + as_adjacency_matrix(graph = graph, type = type, attr = attr, edges = edges, names = names, sparse = sparse) +} # nocov end + +#' Adjacency lists +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.adjlist()` was renamed to `as_adj_list()` to create a more +#' consistent API. +#' @inheritParams as_adj_list +#' @keywords internal +#' @export +get.adjlist <- function(graph , mode = c("all","out","in","total") , loops = c("twice","once","ignore") , multiple = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.adjlist()", "as_adj_list()") + as_adj_list(graph = graph, mode = mode, loops = loops, multiple = multiple) +} # nocov end + +#' Adjacency lists +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.adjedgelist()` was renamed to `as_adj_edge_list()` to create a more +#' consistent API. +#' @inheritParams as_adj_edge_list +#' @keywords internal +#' @export +get.adjedgelist <- function(graph , mode = c("all","out","in","total") , loops = c("twice","once","ignore")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.adjedgelist()", "as_adj_edge_list()") + as_adj_edge_list(graph = graph, mode = mode, loops = loops) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -164,7 +299,6 @@ get.adjacency.sparse <- function(graph, type = c("both", "upper", "lower"), #' defined in the \sQuote{`Matrix`} package, if `sparse` if #' `TRUE`. #' -#' @aliases get.adjacency #' @param graph The graph to convert. #' @param type Gives how to create the adjacency matrix for undirected graphs. #' It is ignored for directed graphs. Possible values: `upper`: the upper @@ -232,7 +366,6 @@ as_adj <- as_adjacency_matrix #' #' `as_edgelist()` returns the list of edges in a graph. #' -#' @aliases get.edgelist #' @param graph The graph to convert. #' @param names Whether to return a character matrix containing vertex #' names (i.e. the `name` vertex attribute) if they exist or numeric @@ -385,7 +518,6 @@ as.undirected <- function(graph, mode = c("collapse", "each", "mutual"), edge.at #' ids of adjacent edges (according to the `mode` argument) of all #' vertices. #' -#' @aliases get.adjedgelist #' @param graph The input graph. #' @param mode Character scalar, it gives what kind of adjacent edges/vertices #' to include in the lists. \sQuote{`out`} is for outgoing edges/vertices, @@ -449,7 +581,6 @@ as_adj_list <- function(graph, } #' @rdname as_adj_list -#' @aliases get.adjlist #' @export as_adj_edge_list <- function(graph, mode = c("all", "out", "in", "total"), @@ -495,7 +626,6 @@ as_adj_edge_list <- function(graph, #' attributes of the multiple edges are lost: they are all replaced by the #' attributes of the first of the multiple edges. #' -#' @aliases igraph.from.graphNEL #' @param graphNEL The graphNEL graph. #' @param name Logical scalar, whether to add graphNEL vertex names as an #' igraph vertex attribute called \sQuote{`name`}. @@ -596,7 +726,6 @@ graph_from_graphnel <- function(graphNEL, name = TRUE, weight = TRUE, #' vertex names in the graphNEL graph. Otherwise numeric igraph vertex ids #' will be used for this purpose. #' -#' @aliases igraph.to.graphNEL #' @param graph An igraph graph object. #' @return `as_graphnel()` returns a graphNEL graph object. #' @seealso [graph_from_graphnel()] for the other direction, @@ -811,7 +940,6 @@ get.incidence.sparse <- function(graph, types, names, attr) { #' boolean and `FALSE` for the vertices of the first kind and `TRUE` #' for vertices of the second kind. #' -#' @aliases get.incidence #' @param graph The input graph. The direction of the edges is ignored in #' directed graphs. #' @param types An optional vertex type vector to use instead of the @@ -932,7 +1060,6 @@ as_data_frame <- function(x, what = c("edges", "vertices", "both")) { #' [as_adj_list()], do your modifications to the graphs and finally #' create again an igraph graph by calling `graph_from_adj_list()`. #' -#' @aliases graph.adjlist #' @param adjlist The adjacency list. It should be consistent, i.e. the maximum #' throughout all vectors in the list must be less than the number of vectors #' (=the number of vertices in the graph). @@ -1069,20 +1196,3 @@ as.matrix.igraph <- function(x, matrix.type = c("adjacency", "edgelist"), ...) { ) } #' @export get.adjedgelist -deprecated("get.adjedgelist", as_adj_edge_list) -#' @export get.adjlist -deprecated("get.adjlist", as_adj_list) -#' @export get.adjacency -deprecated("get.adjacency", as_adjacency_matrix) -#' @export get.data.frame -deprecated("get.data.frame", as_data_frame) -#' @export get.edgelist -deprecated("get.edgelist", as_edgelist) -#' @export get.incidence -deprecated("get.incidence", as_biadjacency_matrix) -#' @export graph.adjlist -deprecated("graph.adjlist", graph_from_adj_list) -#' @export igraph.from.graphNEL -deprecated("igraph.from.graphNEL", graph_from_graphnel) -#' @export igraph.to.graphNEL -deprecated("igraph.to.graphNEL", as_graphnel) diff --git a/man/as_adj_list.Rd b/man/as_adj_list.Rd index c71f8989f61..d181b997f2e 100644 --- a/man/as_adj_list.Rd +++ b/man/as_adj_list.Rd @@ -2,9 +2,7 @@ % Please edit documentation in R/conversion.R \name{as_adj_list} \alias{as_adj_list} -\alias{get.adjedgelist} \alias{as_adj_edge_list} -\alias{get.adjlist} \title{Adjacency lists} \usage{ as_adj_list( diff --git a/man/as_adjacency_matrix.Rd b/man/as_adjacency_matrix.Rd index 46835075049..94e27fcfbf1 100644 --- a/man/as_adjacency_matrix.Rd +++ b/man/as_adjacency_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{as_adjacency_matrix} \alias{as_adjacency_matrix} -\alias{get.adjacency} \alias{as_adj} \title{Convert a graph to an adjacency matrix} \usage{ diff --git a/man/as_biadjacency_matrix.Rd b/man/as_biadjacency_matrix.Rd index 18e27092556..bc40afa0f65 100644 --- a/man/as_biadjacency_matrix.Rd +++ b/man/as_biadjacency_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{as_biadjacency_matrix} \alias{as_biadjacency_matrix} -\alias{get.incidence} \title{Bipartite adjacency matrix of a bipartite graph} \usage{ as_biadjacency_matrix( diff --git a/man/as_edgelist.Rd b/man/as_edgelist.Rd index 2a62c68e448..cb3db5ee491 100644 --- a/man/as_edgelist.Rd +++ b/man/as_edgelist.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{as_edgelist} \alias{as_edgelist} -\alias{get.edgelist} \title{Convert a graph to an edge list} \usage{ as_edgelist(graph, names = TRUE) diff --git a/man/as_graphnel.Rd b/man/as_graphnel.Rd index 53d9a5f1b8c..02326fcf664 100644 --- a/man/as_graphnel.Rd +++ b/man/as_graphnel.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{as_graphnel} \alias{as_graphnel} -\alias{igraph.to.graphNEL} \title{Convert igraph graphs to graphNEL objects from the graph package} \usage{ as_graphnel(graph) diff --git a/man/get.adjacency.Rd b/man/get.adjacency.Rd new file mode 100644 index 00000000000..28608d50bd6 --- /dev/null +++ b/man/get.adjacency.Rd @@ -0,0 +1,55 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.adjacency} +\alias{get.adjacency} +\title{Convert a graph to an adjacency matrix} +\usage{ +get.adjacency( + graph, + type = c("both", "upper", "lower"), + attr = NULL, + edges = FALSE, + names = TRUE, + sparse = igraph_opt("sparsematrices") +) +} +\arguments{ +\item{graph}{The graph to convert.} + +\item{type}{Gives how to create the adjacency matrix for undirected graphs. +It is ignored for directed graphs. Possible values: \code{upper}: the upper +right triangle of the matrix is used, \code{lower}: the lower left triangle +of the matrix is used. \code{both}: the whole matrix is used, a symmetric +matrix is returned.} + +\item{attr}{Either \code{NULL} or a character string giving an edge +attribute name. If \code{NULL} a traditional adjacency matrix is returned. +If not \code{NULL} then the values of the given edge attribute are included +in the adjacency matrix. If the graph has multiple edges, the edge attribute +of an arbitrarily chosen edge (for the multiple edges) is included. This +argument is ignored if \code{edges} is \code{TRUE}. + +Note that this works only for certain attribute types. If the \code{sparse} +argumen is \code{TRUE}, then the attribute must be either logical or +numeric. If the \code{sparse} argument is \code{FALSE}, then character is +also allowed. The reason for the difference is that the \code{Matrix} +package does not support character sparse matrices yet.} + +\item{edges}{Logical scalar, whether to return the edge ids in the matrix. +For non-existant edges zero is returned.} + +\item{names}{Logical constant, whether to assign row and column names +to the matrix. These are only assigned if the \code{name} vertex attribute +is present in the graph.} + +\item{sparse}{Logical scalar, whether to create a sparse matrix. The +\sQuote{\code{Matrix}} package must be installed for creating sparse +matrices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.adjacency()} was renamed to \code{as_adjacency_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.adjedgelist.Rd b/man/get.adjedgelist.Rd new file mode 100644 index 00000000000..e3f48eff32f --- /dev/null +++ b/man/get.adjedgelist.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.adjedgelist} +\alias{get.adjedgelist} +\title{Adjacency lists} +\usage{ +get.adjedgelist( + graph, + mode = c("all", "out", "in", "total"), + loops = c("twice", "once", "ignore") +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{mode}{Character scalar, it gives what kind of adjacent edges/vertices +to include in the lists. \sQuote{\code{out}} is for outgoing edges/vertices, +\sQuote{\verb{in}} is for incoming edges/vertices, \sQuote{\code{all}} is +for both. This argument is ignored for undirected graphs.} + +\item{loops}{Character scalar, one of \code{"ignore"} (to omit loops), \code{"twice"} +(to include loop edges twice) and \code{"once"} (to include them once). \code{"twice"} +is not allowed for directed graphs and will be replaced with \code{"once"}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.adjedgelist()} was renamed to \code{as_adj_edge_list()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.adjlist.Rd b/man/get.adjlist.Rd new file mode 100644 index 00000000000..c595650131e --- /dev/null +++ b/man/get.adjlist.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.adjlist} +\alias{get.adjlist} +\title{Adjacency lists} +\usage{ +get.adjlist( + graph, + mode = c("all", "out", "in", "total"), + loops = c("twice", "once", "ignore"), + multiple = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{mode}{Character scalar, it gives what kind of adjacent edges/vertices +to include in the lists. \sQuote{\code{out}} is for outgoing edges/vertices, +\sQuote{\verb{in}} is for incoming edges/vertices, \sQuote{\code{all}} is +for both. This argument is ignored for undirected graphs.} + +\item{loops}{Character scalar, one of \code{"ignore"} (to omit loops), \code{"twice"} +(to include loop edges twice) and \code{"once"} (to include them once). \code{"twice"} +is not allowed for directed graphs and will be replaced with \code{"once"}.} + +\item{multiple}{Logical scalar, set to \code{FALSE} to use only one representative +of each set of parallel edges.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.adjlist()} was renamed to \code{as_adj_list()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.data.frame.Rd b/man/get.data.frame.Rd new file mode 100644 index 00000000000..9e0091f5617 --- /dev/null +++ b/man/get.data.frame.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.data.frame} +\alias{get.data.frame} +\title{Creating igraph graphs from data frames or vice-versa} +\usage{ +get.data.frame(x, what = c("edges", "vertices", "both")) +} +\arguments{ +\item{x}{An igraph object.} + +\item{what}{Character constant, whether to return info about vertices, +edges, or both. The default is \sQuote{edges}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.data.frame()} was renamed to \code{as_data_frame()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.edgelist.Rd b/man/get.edgelist.Rd new file mode 100644 index 00000000000..3ec792add93 --- /dev/null +++ b/man/get.edgelist.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.edgelist} +\alias{get.edgelist} +\title{Convert a graph to an edge list} +\usage{ +get.edgelist(graph, names = TRUE) +} +\arguments{ +\item{graph}{The graph to convert.} + +\item{names}{Whether to return a character matrix containing vertex +names (i.e. the \code{name} vertex attribute) if they exist or numeric +vertex ids.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.edgelist()} was renamed to \code{as_edgelist()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.incidence.Rd b/man/get.incidence.Rd new file mode 100644 index 00000000000..e89865d804f --- /dev/null +++ b/man/get.incidence.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{get.incidence} +\alias{get.incidence} +\title{Bipartite adjacency matrix of a bipartite graph} +\usage{ +get.incidence(graph, types = NULL, attr = NULL, names = TRUE, sparse = FALSE) +} +\arguments{ +\item{graph}{The input graph. The direction of the edges is ignored in +directed graphs.} + +\item{types}{An optional vertex type vector to use instead of the +\code{type} vertex attribute. You must supply this argument if the graph has +no \code{type} vertex attribute.} + +\item{attr}{Either \code{NULL} or a character string giving an edge +attribute name. If \code{NULL}, then a traditional bipartite adjacency matrix is +returned. If not \code{NULL} then the values of the given edge attribute are +included in the bipartite adjacency matrix. If the graph has multiple edges, the edge +attribute of an arbitrarily chosen edge (for the multiple edges) is +included.} + +\item{names}{Logical scalar, if \code{TRUE} and the vertices in the graph +are named (i.e. the graph has a vertex attribute called \code{name}), then +vertex names will be added to the result as row and column names. Otherwise +the ids of the vertices are used as row and column names.} + +\item{sparse}{Logical scalar, if it is \code{TRUE} then a sparse matrix is +created, you will need the \code{Matrix} package for this.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.incidence()} was renamed to \code{as_biadjacency_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.adjlist.Rd b/man/graph.adjlist.Rd new file mode 100644 index 00000000000..dfa897ac47b --- /dev/null +++ b/man/graph.adjlist.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{graph.adjlist} +\alias{graph.adjlist} +\title{Create graphs from adjacency lists} +\usage{ +graph.adjlist(adjlist, mode = c("out", "in", "all", "total"), duplicate = TRUE) +} +\arguments{ +\item{adjlist}{The adjacency list. It should be consistent, i.e. the maximum +throughout all vectors in the list must be less than the number of vectors +(=the number of vertices in the graph).} + +\item{mode}{Character scalar, it specifies whether the graph to create is +undirected (\sQuote{all} or \sQuote{total}) or directed; and in the latter +case, whether it contains the outgoing (\sQuote{out}) or the incoming +(\sQuote{in}) neighbors of the vertices.} + +\item{duplicate}{Logical scalar. For undirected graphs it gives whether +edges are included in the list twice. E.g. if it is \code{TRUE} then for an +undirected \code{{A,B}} edge \code{graph_from_adj_list()} expects \code{A} +included in the neighbors of \code{B} and \code{B} to be included in the +neighbors of \code{A}. + +This argument is ignored if \code{mode} is \code{out} or \verb{in}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.adjlist()} was renamed to \code{graph_from_adj_list()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_adj_list.Rd b/man/graph_from_adj_list.Rd index 21ecdb70ebc..c200be3fbd1 100644 --- a/man/graph_from_adj_list.Rd +++ b/man/graph_from_adj_list.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{graph_from_adj_list} \alias{graph_from_adj_list} -\alias{graph.adjlist} \title{Create graphs from adjacency lists} \usage{ graph_from_adj_list( diff --git a/man/graph_from_graphnel.Rd b/man/graph_from_graphnel.Rd index 0dfc1dd48e9..f8e69bac82a 100644 --- a/man/graph_from_graphnel.Rd +++ b/man/graph_from_graphnel.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/conversion.R \name{graph_from_graphnel} \alias{graph_from_graphnel} -\alias{igraph.from.graphNEL} \title{Convert graphNEL objects from the graph package to igraph} \usage{ graph_from_graphnel(graphNEL, name = TRUE, weight = TRUE, unlist.attrs = TRUE) diff --git a/man/igraph.from.graphNEL.Rd b/man/igraph.from.graphNEL.Rd new file mode 100644 index 00000000000..2731a8d70c1 --- /dev/null +++ b/man/igraph.from.graphNEL.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{igraph.from.graphNEL} +\alias{igraph.from.graphNEL} +\title{Convert graphNEL objects from the graph package to igraph} +\usage{ +igraph.from.graphNEL(graphNEL, name = TRUE, weight = TRUE, unlist.attrs = TRUE) +} +\arguments{ +\item{graphNEL}{The graphNEL graph.} + +\item{name}{Logical scalar, whether to add graphNEL vertex names as an +igraph vertex attribute called \sQuote{\code{name}}.} + +\item{weight}{Logical scalar, whether to add graphNEL edge weights as an +igraph edge attribute called \sQuote{\code{weight}}. (graphNEL graphs are +always weighted.)} + +\item{unlist.attrs}{Logical scalar. graphNEL attribute query functions +return the values of the attributes in R lists, if this argument is +\code{TRUE} (the default) these will be converted to atomic vectors, +whenever possible, before adding them to the igraph graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.from.graphNEL()} was renamed to \code{graph_from_graphnel()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph.to.graphNEL.Rd b/man/igraph.to.graphNEL.Rd new file mode 100644 index 00000000000..7825b1e4563 --- /dev/null +++ b/man/igraph.to.graphNEL.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/conversion.R +\name{igraph.to.graphNEL} +\alias{igraph.to.graphNEL} +\title{Convert igraph graphs to graphNEL objects from the graph package} +\usage{ +igraph.to.graphNEL(graph) +} +\arguments{ +\item{graph}{An igraph graph object.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.to.graphNEL()} was renamed to \code{as_graphnel()} to create a more +consistent API. +} +\keyword{internal} From e66fd7bc6897d47aa8d67abcf4047a8330ef6893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:58:01 +0100 Subject: [PATCH 17/48] refactor!: change R/data_frame.R --- R/data_frame.R | 35 ++++++++++++++++++++++++++++++----- man/graph.data.frame.Rd | 27 +++++++++++++++++++++++++++ man/graph.edgelist.Rd | 20 ++++++++++++++++++++ man/graph_from_data_frame.Rd | 2 -- man/graph_from_edgelist.Rd | 1 - 5 files changed, 77 insertions(+), 8 deletions(-) create mode 100644 man/graph.data.frame.Rd create mode 100644 man/graph.edgelist.Rd diff --git a/R/data_frame.R b/R/data_frame.R index 231214d8277..63c475038ed 100644 --- a/R/data_frame.R +++ b/R/data_frame.R @@ -1,4 +1,34 @@ +#' Create a graph from an edge list matrix +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.edgelist()` was renamed to `graph_from_edgelist()` to create a more +#' consistent API. +#' @inheritParams graph_from_edgelist +#' @keywords internal +#' @export +graph.edgelist <- function(el , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.edgelist()", "graph_from_edgelist()") + graph_from_edgelist(el = el, directed = directed) +} # nocov end + +#' Creating igraph graphs from data frames or vice-versa +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.data.frame()` was renamed to `graph_from_data_frame()` to create a more +#' consistent API. +#' @inheritParams graph_from_data_frame +#' @keywords internal +#' @export +graph.data.frame <- function(d , directed = TRUE , vertices = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.data.frame()", "graph_from_data_frame()") + graph_from_data_frame(d = d, directed = directed, vertices = vertices) +} # nocov end + ## ---------------------------------------------------------------- ## ## IGraph R package @@ -69,7 +99,6 @@ #' If the `what` argument is `both`, then both vertex and edge data #' is returned, in a list with named entries `vertices` and `edges`. #' -#' @aliases graph.data.frame get.data.frame #' @param d A data frame containing a symbolic edge list in the first two #' columns. Additional columns are considered as edge attributes. Since #' version 0.7 this argument is coerced to a data frame with @@ -218,7 +247,6 @@ from_data_frame <- function(...) constructor_spec(graph_from_data_frame, ...) #' names and a vertex id will be assigned to each name, and also a #' `name` vertex attribute will be added. #' -#' @aliases graph.edgelist #' @concept Edge list #' @param el The edge list, a two column matrix, character or numeric. #' @param directed Whether to create a directed graph. @@ -262,6 +290,3 @@ graph_from_edgelist <- function(el, directed = TRUE) { #' @export from_edgelist <- function(...) constructor_spec(graph_from_edgelist, ...) #' @export graph.data.frame -deprecated("graph.data.frame", graph_from_data_frame) -#' @export graph.edgelist -deprecated("graph.edgelist", graph_from_edgelist) diff --git a/man/graph.data.frame.Rd b/man/graph.data.frame.Rd new file mode 100644 index 00000000000..3edbba9ce89 --- /dev/null +++ b/man/graph.data.frame.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data_frame.R +\name{graph.data.frame} +\alias{graph.data.frame} +\title{Creating igraph graphs from data frames or vice-versa} +\usage{ +graph.data.frame(d, directed = TRUE, vertices = NULL) +} +\arguments{ +\item{d}{A data frame containing a symbolic edge list in the first two +columns. Additional columns are considered as edge attributes. Since +version 0.7 this argument is coerced to a data frame with +\code{as.data.frame}.} + +\item{directed}{Logical scalar, whether or not to create a directed graph.} + +\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 +with \code{as.data.frame}, if not \code{NULL}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.data.frame()} was renamed to \code{graph_from_data_frame()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.edgelist.Rd b/man/graph.edgelist.Rd new file mode 100644 index 00000000000..3d87bfaf33c --- /dev/null +++ b/man/graph.edgelist.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data_frame.R +\name{graph.edgelist} +\alias{graph.edgelist} +\title{Create a graph from an edge list matrix} +\usage{ +graph.edgelist(el, directed = TRUE) +} +\arguments{ +\item{el}{The edge list, a two column matrix, character or numeric.} + +\item{directed}{Whether to create a directed graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.edgelist()} was renamed to \code{graph_from_edgelist()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_data_frame.Rd b/man/graph_from_data_frame.Rd index 4f7c66b9fa4..afcbdd549a5 100644 --- a/man/graph_from_data_frame.Rd +++ b/man/graph_from_data_frame.Rd @@ -3,8 +3,6 @@ \name{as_data_frame} \alias{as_data_frame} \alias{graph_from_data_frame} -\alias{graph.data.frame} -\alias{get.data.frame} \alias{from_data_frame} \title{Creating igraph graphs from data frames or vice-versa} \usage{ diff --git a/man/graph_from_edgelist.Rd b/man/graph_from_edgelist.Rd index 0376e2b9e99..122ba54251e 100644 --- a/man/graph_from_edgelist.Rd +++ b/man/graph_from_edgelist.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/data_frame.R \name{graph_from_edgelist} \alias{graph_from_edgelist} -\alias{graph.edgelist} \alias{from_edgelist} \title{Create a graph from an edge list matrix} \usage{ From 285e1f620af497a1054c6434cc0207266b7afe0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:58:30 +0100 Subject: [PATCH 18/48] refactor!: change R/decomposition.R --- R/decomposition.R | 17 +++++++++++++++-- man/is.chordal.Rd | 38 ++++++++++++++++++++++++++++++++++++++ man/is_chordal.Rd | 1 - 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 man/is.chordal.Rd diff --git a/R/decomposition.R b/R/decomposition.R index ac93e60e9e5..0d8801ddc55 100644 --- a/R/decomposition.R +++ b/R/decomposition.R @@ -1,3 +1,18 @@ + +#' Chordality of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.chordal()` was renamed to `is_chordal()` to create a more +#' consistent API. +#' @inheritParams is_chordal +#' @keywords internal +#' @export +is.chordal <- function(graph , alpha = NULL , alpham1 = NULL , fillin = FALSE , newgraph = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.chordal()", "is_chordal()") + is_chordal(graph = graph, alpha = alpha, alpham1 = alpham1, fillin = fillin, newgraph = newgraph) +} # nocov end # IGraph R package # Copyright (C) 2008-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -40,7 +55,6 @@ #' #' It is also true that adding the fill-in edges to the graph makes it chordal. #' -#' @aliases is.chordal #' @param graph The input graph. It may be directed, but edge directions are #' ignored, as the algorithm is defined for undirected graphs. #' @param alpha Numeric vector, the maximal chardinality ordering of the @@ -107,4 +121,3 @@ is_chordal <- function(graph, alpha = NULL, alpham1 = NULL, res } #' @export is.chordal -deprecated("is.chordal", is_chordal) diff --git a/man/is.chordal.Rd b/man/is.chordal.Rd new file mode 100644 index 00000000000..d11da484157 --- /dev/null +++ b/man/is.chordal.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/decomposition.R +\name{is.chordal} +\alias{is.chordal} +\title{Chordality of a graph} +\usage{ +is.chordal( + graph, + alpha = NULL, + alpham1 = NULL, + fillin = FALSE, + newgraph = FALSE +) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored, as the algorithm is defined for undirected graphs.} + +\item{alpha}{Numeric vector, the maximal chardinality ordering of the +vertices. If it is \code{NULL}, then it is automatically calculated by +calling \code{\link[=max_cardinality]{max_cardinality()}}, or from \code{alpham1} if +that is given..} + +\item{alpham1}{Numeric vector, the inverse of \code{alpha}. If it is +\code{NULL}, then it is automatically calculated by calling +\code{\link[=max_cardinality]{max_cardinality()}}, or from \code{alpha}.} + +\item{fillin}{Logical scalar, whether to calculate the fill-in edges.} + +\item{newgraph}{Logical scalar, whether to calculate the triangulated graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.chordal()} was renamed to \code{is_chordal()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_chordal.Rd b/man/is_chordal.Rd index 576094a3deb..35d8a3f0c7b 100644 --- a/man/is_chordal.Rd +++ b/man/is_chordal.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/decomposition.R \name{is_chordal} \alias{is_chordal} -\alias{is.chordal} \title{Chordality of a graph} \usage{ is_chordal( From 6d4a441ffc75bc812e23ee326534f6b0e504f18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:59:02 +0100 Subject: [PATCH 19/48] refactor!: change R/degseq.R --- R/degseq.R | 36 +++++++++++++++++++++++++---- man/is.degree.sequence.Rd | 22 ++++++++++++++++++ man/is.graphical.degree.sequence.Rd | 33 ++++++++++++++++++++++++++ man/is_degseq.Rd | 1 - man/is_graphical.Rd | 1 - 5 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 man/is.degree.sequence.Rd create mode 100644 man/is.graphical.degree.sequence.Rd diff --git a/R/degseq.R b/R/degseq.R index 223c7733200..f163dbd21d4 100644 --- a/R/degseq.R +++ b/R/degseq.R @@ -1,4 +1,34 @@ +#' Is a degree sequence graphical? +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.graphical.degree.sequence()` was renamed to `is_graphical()` to create a more +#' consistent API. +#' @inheritParams is_graphical +#' @keywords internal +#' @export +is.graphical.degree.sequence <- function(out.deg , in.deg = NULL , allowed.edge.types = c("simple","loops","multi","all")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.graphical.degree.sequence()", "is_graphical()") + is_graphical(out.deg = out.deg, in.deg = in.deg, allowed.edge.types = allowed.edge.types) +} # nocov end + +#' Check if a degree sequence is valid for a multi-graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.degree.sequence()` was renamed to `is_degseq()` to create a more +#' consistent API. +#' @inheritParams is_degseq +#' @keywords internal +#' @export +is.degree.sequence <- function(out.deg , in.deg = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.degree.sequence()", "is_degseq()") + is_degseq(out.deg = out.deg, in.deg = in.deg) +} # nocov end + ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -32,7 +62,7 @@ #' degree vectors are equal and whether their sums are also equal. These are #' known sufficient and necessary conditions for a degree sequence to be valid. #' -#' @aliases is.degree.sequence is_degseq +#' @aliases is_degseq #' @param out.deg Integer vector, the degree sequence for undirected graphs, or #' the out-degree sequence for directed graphs. #' @param in.deg `NULL` or an integer vector. For undirected graphs, it @@ -70,7 +100,6 @@ is_degseq <- function(out.deg, in.deg = NULL) { #' can perform the check also when self-loops, multi-edges, or both are allowed #' in the graph. #' -#' @aliases is.graphical.degree.sequence #' @param out.deg Integer vector, the degree sequence for undirected graphs, or #' the out-degree sequence for directed graphs. #' @param in.deg `NULL` or an integer vector. For undirected graphs, it @@ -99,6 +128,3 @@ is_degseq <- function(out.deg, in.deg = NULL) { #' @export is_graphical <- is_graphical_impl #' @export is.degree.sequence -deprecated("is.degree.sequence", is_degseq) -#' @export is.graphical.degree.sequence -deprecated("is.graphical.degree.sequence", is_graphical) diff --git a/man/is.degree.sequence.Rd b/man/is.degree.sequence.Rd new file mode 100644 index 00000000000..a094c08539e --- /dev/null +++ b/man/is.degree.sequence.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/degseq.R +\name{is.degree.sequence} +\alias{is.degree.sequence} +\title{Check if a degree sequence is valid for a multi-graph} +\usage{ +is.degree.sequence(out.deg, in.deg = NULL) +} +\arguments{ +\item{out.deg}{Integer vector, the degree sequence for undirected graphs, or +the out-degree sequence for directed graphs.} + +\item{in.deg}{\code{NULL} or an integer vector. For undirected graphs, it +should be \code{NULL}. For directed graphs it specifies the in-degrees.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.degree.sequence()} was renamed to \code{is_degseq()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.graphical.degree.sequence.Rd b/man/is.graphical.degree.sequence.Rd new file mode 100644 index 00000000000..083dd3dffd9 --- /dev/null +++ b/man/is.graphical.degree.sequence.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/degseq.R +\name{is.graphical.degree.sequence} +\alias{is.graphical.degree.sequence} +\title{Is a degree sequence graphical?} +\usage{ +is.graphical.degree.sequence( + out.deg, + in.deg = NULL, + allowed.edge.types = c("simple", "loops", "multi", "all") +) +} +\arguments{ +\item{out.deg}{Integer vector, the degree sequence for undirected graphs, or +the out-degree sequence for directed graphs.} + +\item{in.deg}{\code{NULL} or an integer vector. For undirected graphs, it +should be \code{NULL}. For directed graphs it specifies the in-degrees.} + +\item{allowed.edge.types}{The allowed edge types in the graph. \sQuote{simple} +means that neither loop nor multiple edges are allowed (i.e. the graph must be +simple). \sQuote{loops} means that loop edges are allowed but mutiple edges +are not. \sQuote{multi} means that multiple edges are allowed but loop edges +are not. \sQuote{all} means that both loop edges and multiple edges are +allowed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.graphical.degree.sequence()} was renamed to \code{is_graphical()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_degseq.Rd b/man/is_degseq.Rd index 403d7f058fa..0e5d8708b1c 100644 --- a/man/is_degseq.Rd +++ b/man/is_degseq.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/degseq.R \name{is_degseq} \alias{is_degseq} -\alias{is.degree.sequence} \title{Check if a degree sequence is valid for a multi-graph} \usage{ is_degseq(out.deg, in.deg = NULL) diff --git a/man/is_graphical.Rd b/man/is_graphical.Rd index faa2ba2dccd..bdbdc81464d 100644 --- a/man/is_graphical.Rd +++ b/man/is_graphical.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/degseq.R \name{is_graphical} \alias{is_graphical} -\alias{is.graphical.degree.sequence} \title{Is a degree sequence graphical?} \usage{ is_graphical( From b237cb7d10676a0da011cf0bdcf9483c02c86f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 14:59:31 +0100 Subject: [PATCH 20/48] refactor!: change R/demo.R --- R/demo.R | 17 +++++++++++++++-- man/igraph_demo.Rd | 1 - man/igraphdemo.Rd | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 man/igraphdemo.Rd diff --git a/R/demo.R b/R/demo.R index b278efff502..e349cc2115d 100644 --- a/R/demo.R +++ b/R/demo.R @@ -1,3 +1,18 @@ + +#' Run igraph demos, step by step +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraphdemo()` was renamed to `igraph_demo()` to create a more +#' consistent API. +#' @inheritParams igraph_demo +#' @keywords internal +#' @export +igraphdemo <- function(which) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraphdemo()", "igraph_demo()") + igraph_demo(which = which) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -33,7 +48,6 @@ #' #' The `tcltk` package is needed for `igraph_demo()`. #' -#' @aliases igraphdemo #' @param which If not given, then the names of the available demos are listed. #' Otherwise it should be either a filename or the name of an igraph demo. #' @return Returns `NULL`, invisibly. @@ -193,4 +207,3 @@ igraph_demo <- function(which) { invisible() } #' @export igraphdemo -deprecated("igraphdemo", igraph_demo) diff --git a/man/igraph_demo.Rd b/man/igraph_demo.Rd index 652add7f60d..65277fd0d0b 100644 --- a/man/igraph_demo.Rd +++ b/man/igraph_demo.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/demo.R \name{igraph_demo} \alias{igraph_demo} -\alias{igraphdemo} \title{Run igraph demos, step by step} \usage{ igraph_demo(which) diff --git a/man/igraphdemo.Rd b/man/igraphdemo.Rd new file mode 100644 index 00000000000..a03b308fd12 --- /dev/null +++ b/man/igraphdemo.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/demo.R +\name{igraphdemo} +\alias{igraphdemo} +\title{Run igraph demos, step by step} +\usage{ +igraphdemo(which) +} +\arguments{ +\item{which}{If not given, then the names of the available demos are listed. +Otherwise it should be either a filename or the name of an igraph demo.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraphdemo()} was renamed to \code{igraph_demo()} to create a more +consistent API. +} +\keyword{internal} From a1430d596edc0d7c486d805e03e7c4f5413eef5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:00:03 +0100 Subject: [PATCH 21/48] refactor!: change R/fit.R --- R/fit.R | 17 +++++++++++++-- man/fit_power_law.Rd | 1 - man/power.law.fit.Rd | 52 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 man/power.law.fit.Rd diff --git a/R/fit.R b/R/fit.R index c286a9dbefb..abb623ee149 100644 --- a/R/fit.R +++ b/R/fit.R @@ -1,3 +1,18 @@ + +#' Fitting a power-law distribution function to discrete data +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `power.law.fit()` was renamed to `fit_power_law()` to create a more +#' consistent API. +#' @inheritParams fit_power_law +#' @keywords internal +#' @export +power.law.fit <- function(x , xmin = NULL , start = 2 , force.continuous = FALSE , implementation = c("plfit","R.mle") , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "power.law.fit()", "fit_power_law()") + fit_power_law(x = x, xmin = xmin, start = start, force.continuous = force.continuous, implementation = implementation, ...) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -56,7 +71,6 @@ #' The function uses the method of Clauset, Shalizi and Newman to calculate the #' parameters of the fitted distribution. See references below for the details. #' -#' @aliases power.law.fit #' @param x The data to fit, a numeric vector. For implementation #' \sQuote{`R.mle`} the data must be integer values. For the #' \sQuote{`plfit`} implementation non-integer values might be present and @@ -185,4 +199,3 @@ power.law.fit.new <- function(data, xmin = -1, force.continuous = FALSE) { res } #' @export power.law.fit -deprecated("power.law.fit", fit_power_law) diff --git a/man/fit_power_law.Rd b/man/fit_power_law.Rd index f58242b10af..17ee0dc548b 100644 --- a/man/fit_power_law.Rd +++ b/man/fit_power_law.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/fit.R \name{fit_power_law} \alias{fit_power_law} -\alias{power.law.fit} \title{Fitting a power-law distribution function to discrete data} \usage{ fit_power_law( diff --git a/man/power.law.fit.Rd b/man/power.law.fit.Rd new file mode 100644 index 00000000000..b898a61d501 --- /dev/null +++ b/man/power.law.fit.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/fit.R +\name{power.law.fit} +\alias{power.law.fit} +\title{Fitting a power-law distribution function to discrete data} +\usage{ +power.law.fit( + x, + xmin = NULL, + start = 2, + force.continuous = FALSE, + implementation = c("plfit", "R.mle"), + ... +) +} +\arguments{ +\item{x}{The data to fit, a numeric vector. For implementation +\sQuote{\code{R.mle}} the data must be integer values. For the +\sQuote{\code{plfit}} implementation non-integer values might be present and +then a continuous power-law distribution is fitted.} + +\item{xmin}{Numeric scalar, or \code{NULL}. The lower bound for fitting the +power-law. If \code{NULL}, the smallest value in \code{x} will be used for +the \sQuote{\code{R.mle}} implementation, and its value will be +automatically determined for the \sQuote{\code{plfit}} implementation. This +argument makes it possible to fit only the tail of the distribution.} + +\item{start}{Numeric scalar. The initial value of the exponent for the +minimizing function, for the \sQuote{\code{R.mle}} implementation. Usually +it is safe to leave this untouched.} + +\item{force.continuous}{Logical scalar. Whether to force a continuous +distribution for the \sQuote{\code{plfit}} implementation, even if the +sample vector contains integer values only (by chance). If this argument is +false, igraph will assume a continuous distribution if at least one sample +is non-integer and assume a discrete distribution otherwise.} + +\item{implementation}{Character scalar. Which implementation to use. See +details below.} + +\item{...}{Additional arguments, passed to the maximum likelihood +optimizing function, \code{\link[stats4:mle]{stats4::mle()}}, if the \sQuote{\code{R.mle}} +implementation is chosen. It is ignored by the \sQuote{\code{plfit}} +implementation.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{power.law.fit()} was renamed to \code{fit_power_law()} to create a more +consistent API. +} +\keyword{internal} From ced42cd1225d88b5a0fd41eb6670fd9279724007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:00:32 +0100 Subject: [PATCH 22/48] refactor!: change R/flow.R --- R/flow.R | 249 ++++++++++++++++++++++++++++----- man/dominator.tree.Rd | 27 ++++ man/dominator_tree.Rd | 1 - man/edge.connectivity.Rd | 32 +++++ man/edge.disjoint.paths.Rd | 32 +++++ man/edge_connectivity.Rd | 3 - man/graph.adhesion.Rd | 26 ++++ man/graph.maxflow.Rd | 26 ++++ man/graph.mincut.Rd | 35 +++++ man/is.minimal.separator.Rd | 22 +++ man/is.separator.Rd | 22 +++ man/is_min_separator.Rd | 1 - man/is_separator.Rd | 1 - man/max_flow.Rd | 1 - man/min_cut.Rd | 1 - man/min_separators.Rd | 1 - man/min_st_separators.Rd | 1 - man/minimal.st.separators.Rd | 19 +++ man/minimum.size.separators.Rd | 19 +++ man/stCuts.Rd | 22 +++ man/stMincuts.Rd | 28 ++++ man/st_cuts.Rd | 1 - man/st_min_cuts.Rd | 1 - man/vertex.connectivity.Rd | 30 ++++ man/vertex.disjoint.paths.Rd | 22 +++ man/vertex_connectivity.Rd | 3 - 26 files changed, 573 insertions(+), 53 deletions(-) create mode 100644 man/dominator.tree.Rd create mode 100644 man/edge.connectivity.Rd create mode 100644 man/edge.disjoint.paths.Rd create mode 100644 man/graph.adhesion.Rd create mode 100644 man/graph.maxflow.Rd create mode 100644 man/graph.mincut.Rd create mode 100644 man/is.minimal.separator.Rd create mode 100644 man/is.separator.Rd create mode 100644 man/minimal.st.separators.Rd create mode 100644 man/minimum.size.separators.Rd create mode 100644 man/stCuts.Rd create mode 100644 man/stMincuts.Rd create mode 100644 man/vertex.connectivity.Rd create mode 100644 man/vertex.disjoint.paths.Rd diff --git a/R/flow.R b/R/flow.R index ae7a1197b6e..cc8c40d7adc 100644 --- a/R/flow.R +++ b/R/flow.R @@ -1,3 +1,213 @@ + +#' Vertex connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `vertex.disjoint.paths()` was renamed to `vertex_disjoint_paths()` to create a more +#' consistent API. +#' @inheritParams vertex_disjoint_paths +#' @keywords internal +#' @export +vertex.disjoint.paths <- function(graph , source = NULL , target = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "vertex.disjoint.paths()", "vertex_disjoint_paths()") + vertex_disjoint_paths(graph = graph, source = source, target = target) +} # nocov end + +#' Vertex connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `vertex.connectivity()` was renamed to `vertex_connectivity()` to create a more +#' consistent API. +#' @inheritParams vertex_connectivity +#' @keywords internal +#' @export +vertex.connectivity <- function(graph , source = NULL , target = NULL , checks = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "vertex.connectivity()", "vertex_connectivity()") + vertex_connectivity(graph = graph, source = source, target = target, checks = checks) +} # nocov end + +#' List all minimum \((s,t)\)-cuts of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `stMincuts()` was renamed to `st_min_cuts()` to create a more +#' consistent API. +#' @inheritParams st_min_cuts +#' @keywords internal +#' @export +stMincuts <- function(graph , source , target , capacity = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "stMincuts()", "st_min_cuts()") + st_min_cuts(graph = graph, source = source, target = target, capacity = capacity) +} # nocov end + +#' List all (s,t)-cuts of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `stCuts()` was renamed to `st_cuts()` to create a more +#' consistent API. +#' @inheritParams st_cuts +#' @keywords internal +#' @export +stCuts <- function(graph , source , target) { # nocov start + lifecycle::deprecate_soft("1.6.0", "stCuts()", "st_cuts()") + st_cuts(graph = graph, source = source, target = target) +} # nocov end + +#' Minimum size vertex separators +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `minimum.size.separators()` was renamed to `min_separators()` to create a more +#' consistent API. +#' @inheritParams min_separators +#' @keywords internal +#' @export +minimum.size.separators <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "minimum.size.separators()", "min_separators()") + min_separators(graph = graph) +} # nocov end + +#' Minimum size vertex separators +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `minimal.st.separators()` was renamed to `min_st_separators()` to create a more +#' consistent API. +#' @inheritParams min_st_separators +#' @keywords internal +#' @export +minimal.st.separators <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "minimal.st.separators()", "min_st_separators()") + min_st_separators(graph = graph) +} # nocov end + +#' Vertex separators +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.separator()` was renamed to `is_separator()` to create a more +#' consistent API. +#' @inheritParams is_separator +#' @keywords internal +#' @export +is.separator <- function(graph , candidate) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.separator()", "is_separator()") + is_separator(graph = graph, candidate = candidate) +} # nocov end + +#' Minimal vertex separators +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.minimal.separator()` was renamed to `is_min_separator()` to create a more +#' consistent API. +#' @inheritParams is_min_separator +#' @keywords internal +#' @export +is.minimal.separator <- function(graph , candidate) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.minimal.separator()", "is_min_separator()") + is_min_separator(graph = graph, candidate = candidate) +} # nocov end + +#' Minimum cut in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.mincut()` was renamed to `min_cut()` to create a more +#' consistent API. +#' @inheritParams min_cut +#' @keywords internal +#' @export +graph.mincut <- function(graph , source = NULL , target = NULL , capacity = NULL , value.only = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.mincut()", "min_cut()") + min_cut(graph = graph, source = source, target = target, capacity = capacity, value.only = value.only) +} # nocov end + +#' Maximum flow in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.maxflow()` was renamed to `max_flow()` to create a more +#' consistent API. +#' @inheritParams max_flow +#' @keywords internal +#' @export +graph.maxflow <- function(graph , source , target , capacity = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.maxflow()", "max_flow()") + max_flow(graph = graph, source = source, target = target, capacity = capacity) +} # nocov end + +#' Edge connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.adhesion()` was renamed to `adhesion()` to create a more +#' consistent API. +#' @inheritParams adhesion +#' @keywords internal +#' @export +graph.adhesion <- function(graph , checks = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.adhesion()", "adhesion()") + adhesion(graph = graph, checks = checks) +} # nocov end + +#' Edge connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `edge.disjoint.paths()` was renamed to `edge_connectivity()` to create a more +#' consistent API. +#' @inheritParams edge_connectivity +#' @keywords internal +#' @export +edge.disjoint.paths <- function(graph , source = NULL , target = NULL , checks = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "edge.disjoint.paths()", "edge_connectivity()") + edge_connectivity(graph = graph, source = source, target = target, checks = checks) +} # nocov end + +#' Edge connectivity +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `edge.connectivity()` was renamed to `edge_connectivity()` to create a more +#' consistent API. +#' @inheritParams edge_connectivity +#' @keywords internal +#' @export +edge.connectivity <- function(graph , source = NULL , target = NULL , checks = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "edge.connectivity()", "edge_connectivity()") + edge_connectivity(graph = graph, source = source, target = target, checks = checks) +} # nocov end + +#' Dominator tree +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `dominator.tree()` was renamed to `dominator_tree()` to create a more +#' consistent API. +#' @inheritParams dominator_tree +#' @keywords internal +#' @export +dominator.tree <- function(graph , root , mode = c("out","in","all","total")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "dominator.tree()", "dominator_tree()") + dominator_tree(graph = graph, root = root, mode = mode) +} # nocov end # IGraph R package # Copyright (C) 2006-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -42,7 +252,6 @@ #' For undirected graphs the Stoer-Wagner algorithm (see reference below) is #' used to calculate the minimum cut. #' -#' @aliases graph.mincut #' @param graph The input graph. #' @param source The id of the source vertex. #' @param target The id of the target vertex (sometimes also called sink). @@ -177,7 +386,7 @@ min_cut <- function(graph, source = NULL, target = NULL, capacity = NULL, value. #' precisely `vertex_connectivity()` is the most general, the other two are #' included only for the ease of using more descriptive function names. #' -#' @aliases vertex.connectivity vertex.disjoint.paths cohesion graph.cohesion +#' @aliases cohesion #' @param graph,x The input graph. #' @param source The id of the source vertex, for `vertex_connectivity()` it #' can be `NULL`, see details below. @@ -268,7 +477,6 @@ vertex_connectivity <- function(graph, source = NULL, target = NULL, checks = TR #' more precisely the most general is `edge_connectivity()`, the others are #' included only for having more descriptive function names. #' -#' @aliases edge.connectivity graph.adhesion edge.disjoint.paths #' @param graph The input graph. #' @param source The id of the source vertex, for `edge_connectivity()` it #' can be `NULL`, see details below. @@ -391,7 +599,6 @@ cohesion.igraph <- function(x, checks = TRUE, ...) { #' removing these edges from \eqn{G} there is no directed path from \eqn{s} to #' \eqn{t}. #' -#' @aliases stCuts #' @param graph The input graph. It must be directed. #' @param source The source vertex. #' @param target The target vertex. @@ -439,7 +646,6 @@ st_cuts <- all_st_cuts_impl #' #' An \eqn{(s,t)}-cut is minimum if it is of the smallest possible size. #' -#' @aliases stMincuts #' @param graph The input graph. It must be directed. #' @param source The id of the source vertex. #' @param target The id of the target vertex. @@ -492,7 +698,6 @@ st_min_cuts <- all_st_mincuts_impl #' This function implements the Lengauer-Tarjan algorithm to construct the #' dominator tree of a directed graph. For details see the reference below. #' -#' @aliases dominator.tree #' @param graph A directed graph. If it is not a flowgraph, and it contains #' some vertices not reachable from the root vertex, then these vertices will #' be collected and returned as part of the result. @@ -567,7 +772,6 @@ dominator_tree <- function(graph, root, mode = c("out", "in", "all", "total")) { #' A \eqn{(s,t)} vertex separator is minimal if none of its subsets is an #' \eqn{(s,t)} vertex separator. #' -#' @aliases minimal.st.separators #' @param graph The input graph. It may be directed, but edge directions are #' ignored. #' @return A list of numeric vectors. Each vector contains a vertex set @@ -606,7 +810,6 @@ min_st_separators <- all_minimal_st_separators_impl #' the flow is the incoming flow of the `target` vertex. The maximum flow #' is the flow of maximum value. #' -#' @aliases graph.maxflow #' @param graph The input graph. #' @param source The id of the source vertex. #' @param target The id of the target vertex (sometimes also called sink). @@ -662,7 +865,6 @@ max_flow <- maxflow_impl #' In the special case of a fully connected graph with \eqn{n} vertices, each #' set of \eqn{n-1} vertices is considered to be a vertex separator. #' -#' @aliases is.separator #' @param graph The input graph. It may be directed, but edge directions are #' ignored. #' @param candidate A numeric vector giving the vertex ids of the candidate @@ -686,7 +888,6 @@ is_separator <- is_separator_impl #' In the special case of a fully connected graph with \eqn{n} vertices, each #' set of \eqn{n-1} vertices is considered to be a vertex separator. #' -#' @aliases is.minimal.separator #' @param graph The input graph. It may be directed, but edge directions are #' ignored. #' @param candidate A numeric vector giving the vertex ids of the candidate @@ -739,7 +940,6 @@ is_min_separator <- is_minimal_separator_impl #' In the special case of a fully connected input graph with \eqn{n} vertices, #' all subsets of size \eqn{n-1} are listed as the result. #' -#' @aliases minimum.size.separators #' @param graph The input graph. It may be directed, but edge directions are #' ignored. #' @return A list of numeric vectors. Each numeric vector is a vertex @@ -797,30 +997,3 @@ is_min_separator <- is_minimal_separator_impl #' min_separators(camp) min_separators <- minimum_size_separators_impl #' @export dominator.tree -deprecated("dominator.tree", dominator_tree) -#' @export edge.connectivity -deprecated("edge.connectivity", edge_connectivity) -#' @export edge.disjoint.paths -deprecated("edge.disjoint.paths", edge_connectivity) -#' @export graph.adhesion -deprecated("graph.adhesion", adhesion) -#' @export graph.maxflow -deprecated("graph.maxflow", max_flow) -#' @export graph.mincut -deprecated("graph.mincut", min_cut) -#' @export is.minimal.separator -deprecated("is.minimal.separator", is_min_separator) -#' @export is.separator -deprecated("is.separator", is_separator) -#' @export minimal.st.separators -deprecated("minimal.st.separators", min_st_separators) -#' @export minimum.size.separators -deprecated("minimum.size.separators", min_separators) -#' @export stCuts -deprecated("stCuts", st_cuts) -#' @export stMincuts -deprecated("stMincuts", st_min_cuts) -#' @export vertex.connectivity -deprecated("vertex.connectivity", vertex_connectivity) -#' @export vertex.disjoint.paths -deprecated("vertex.disjoint.paths", vertex_disjoint_paths) diff --git a/man/dominator.tree.Rd b/man/dominator.tree.Rd new file mode 100644 index 00000000000..98eb4ec1c09 --- /dev/null +++ b/man/dominator.tree.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{dominator.tree} +\alias{dominator.tree} +\title{Dominator tree} +\usage{ +dominator.tree(graph, root, mode = c("out", "in", "all", "total")) +} +\arguments{ +\item{graph}{A directed graph. If it is not a flowgraph, and it contains +some vertices not reachable from the root vertex, then these vertices will +be collected and returned as part of the result.} + +\item{root}{The id of the root (or source) vertex, this will be the root of +the tree.} + +\item{mode}{Constant, must be \sQuote{\verb{in}} or \sQuote{\code{out}}. If +it is \sQuote{\verb{in}}, then all directions are considered as opposite to +the original one in the input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{dominator.tree()} was renamed to \code{dominator_tree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/dominator_tree.Rd b/man/dominator_tree.Rd index 817f5a2147b..230b9b9a40b 100644 --- a/man/dominator_tree.Rd +++ b/man/dominator_tree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{dominator_tree} \alias{dominator_tree} -\alias{dominator.tree} \title{Dominator tree} \usage{ dominator_tree(graph, root, mode = c("out", "in", "all", "total")) diff --git a/man/edge.connectivity.Rd b/man/edge.connectivity.Rd new file mode 100644 index 00000000000..6f14a79fdc5 --- /dev/null +++ b/man/edge.connectivity.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{edge.connectivity} +\alias{edge.connectivity} +\title{Edge connectivity} +\usage{ +edge.connectivity(graph, source = NULL, target = NULL, checks = TRUE) +} +\arguments{ +\item{graph}{The input graph.} + +\item{source}{The id of the source vertex, for \code{edge_connectivity()} it +can be \code{NULL}, see details below.} + +\item{target}{The id of the target vertex, for \code{edge_connectivity()} it +can be \code{NULL}, see details below.} + +\item{checks}{Logical constant. 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 edge 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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{edge.connectivity()} was renamed to \code{edge_connectivity()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/edge.disjoint.paths.Rd b/man/edge.disjoint.paths.Rd new file mode 100644 index 00000000000..35ca4184ca1 --- /dev/null +++ b/man/edge.disjoint.paths.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{edge.disjoint.paths} +\alias{edge.disjoint.paths} +\title{Edge connectivity} +\usage{ +edge.disjoint.paths(graph, source = NULL, target = NULL, checks = TRUE) +} +\arguments{ +\item{graph}{The input graph.} + +\item{source}{The id of the source vertex, for \code{edge_connectivity()} it +can be \code{NULL}, see details below.} + +\item{target}{The id of the target vertex, for \code{edge_connectivity()} it +can be \code{NULL}, see details below.} + +\item{checks}{Logical constant. 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 edge 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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{edge.disjoint.paths()} was renamed to \code{edge_connectivity()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/edge_connectivity.Rd b/man/edge_connectivity.Rd index bd9a51739a1..b3d03272ffb 100644 --- a/man/edge_connectivity.Rd +++ b/man/edge_connectivity.Rd @@ -2,9 +2,6 @@ % Please edit documentation in R/flow.R \name{edge_connectivity} \alias{edge_connectivity} -\alias{edge.connectivity} -\alias{graph.adhesion} -\alias{edge.disjoint.paths} \alias{edge_disjoint_paths} \alias{adhesion} \title{Edge connectivity} diff --git a/man/graph.adhesion.Rd b/man/graph.adhesion.Rd new file mode 100644 index 00000000000..75064997cb7 --- /dev/null +++ b/man/graph.adhesion.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{graph.adhesion} +\alias{graph.adhesion} +\title{Edge connectivity} +\usage{ +graph.adhesion(graph, checks = TRUE) +} +\arguments{ +\item{graph}{The input graph.} + +\item{checks}{Logical constant. 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 edge 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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.adhesion()} was renamed to \code{adhesion()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.maxflow.Rd b/man/graph.maxflow.Rd new file mode 100644 index 00000000000..ba39c71a56e --- /dev/null +++ b/man/graph.maxflow.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{graph.maxflow} +\alias{graph.maxflow} +\title{Maximum flow in a graph} +\usage{ +graph.maxflow(graph, source, target, capacity = NULL) +} +\arguments{ +\item{graph}{The input graph.} + +\item{source}{The id of the source vertex.} + +\item{target}{The id of the target vertex (sometimes also called sink).} + +\item{capacity}{Vector giving the capacity of the edges. If this is +\code{NULL} (the default) then the \code{capacity} edge attribute is used. +Note that the \code{weight} edge attribute is not used by this function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.maxflow()} was renamed to \code{max_flow()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.mincut.Rd b/man/graph.mincut.Rd new file mode 100644 index 00000000000..bfd204590cf --- /dev/null +++ b/man/graph.mincut.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{graph.mincut} +\alias{graph.mincut} +\title{Minimum cut in a graph} +\usage{ +graph.mincut( + graph, + source = NULL, + target = NULL, + capacity = NULL, + value.only = TRUE +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{source}{The id of the source vertex.} + +\item{target}{The id of the target vertex (sometimes also called sink).} + +\item{capacity}{Vector giving the capacity of the edges. If this is +\code{NULL} (the default) then the \code{capacity} edge attribute is used.} + +\item{value.only}{Logical scalar, if \code{TRUE} only the minimum cut value +is returned, if \code{FALSE} the edges in the cut and a the two (or more) +partitions are also returned.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.mincut()} was renamed to \code{min_cut()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.minimal.separator.Rd b/man/is.minimal.separator.Rd new file mode 100644 index 00000000000..7dd2ab7f1b7 --- /dev/null +++ b/man/is.minimal.separator.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{is.minimal.separator} +\alias{is.minimal.separator} +\title{Minimal vertex separators} +\usage{ +is.minimal.separator(graph, candidate) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored.} + +\item{candidate}{A numeric vector giving the vertex ids of the candidate +separator.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.minimal.separator()} was renamed to \code{is_min_separator()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.separator.Rd b/man/is.separator.Rd new file mode 100644 index 00000000000..3e5daeb31ed --- /dev/null +++ b/man/is.separator.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{is.separator} +\alias{is.separator} +\title{Vertex separators} +\usage{ +is.separator(graph, candidate) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored.} + +\item{candidate}{A numeric vector giving the vertex ids of the candidate +separator.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.separator()} was renamed to \code{is_separator()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_min_separator.Rd b/man/is_min_separator.Rd index 93cb3d62207..00714c7c96f 100644 --- a/man/is_min_separator.Rd +++ b/man/is_min_separator.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{is_min_separator} \alias{is_min_separator} -\alias{is.minimal.separator} \title{Minimal vertex separators} \usage{ is_min_separator(graph, candidate) diff --git a/man/is_separator.Rd b/man/is_separator.Rd index 086d0312a80..45b4d84ae32 100644 --- a/man/is_separator.Rd +++ b/man/is_separator.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{is_separator} \alias{is_separator} -\alias{is.separator} \title{Vertex separators} \usage{ is_separator(graph, candidate) diff --git a/man/max_flow.Rd b/man/max_flow.Rd index c18c6daaf95..b0dfa40d5d7 100644 --- a/man/max_flow.Rd +++ b/man/max_flow.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{max_flow} \alias{max_flow} -\alias{graph.maxflow} \title{Maximum flow in a graph} \usage{ max_flow(graph, source, target, capacity = NULL) diff --git a/man/min_cut.Rd b/man/min_cut.Rd index 45d5c872bf4..4484381c84d 100644 --- a/man/min_cut.Rd +++ b/man/min_cut.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{min_cut} \alias{min_cut} -\alias{graph.mincut} \title{Minimum cut in a graph} \usage{ min_cut( diff --git a/man/min_separators.Rd b/man/min_separators.Rd index 4c7016b8455..fce937f3eee 100644 --- a/man/min_separators.Rd +++ b/man/min_separators.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{min_separators} \alias{min_separators} -\alias{minimum.size.separators} \title{Minimum size vertex separators} \usage{ min_separators(graph) diff --git a/man/min_st_separators.Rd b/man/min_st_separators.Rd index 4c929869545..aa69d7fb493 100644 --- a/man/min_st_separators.Rd +++ b/man/min_st_separators.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{min_st_separators} \alias{min_st_separators} -\alias{minimal.st.separators} \title{Minimum size vertex separators} \usage{ min_st_separators(graph) diff --git a/man/minimal.st.separators.Rd b/man/minimal.st.separators.Rd new file mode 100644 index 00000000000..fc5457b6418 --- /dev/null +++ b/man/minimal.st.separators.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{minimal.st.separators} +\alias{minimal.st.separators} +\title{Minimum size vertex separators} +\usage{ +minimal.st.separators(graph) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{minimal.st.separators()} was renamed to \code{min_st_separators()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/minimum.size.separators.Rd b/man/minimum.size.separators.Rd new file mode 100644 index 00000000000..ae1afad9829 --- /dev/null +++ b/man/minimum.size.separators.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{minimum.size.separators} +\alias{minimum.size.separators} +\title{Minimum size vertex separators} +\usage{ +minimum.size.separators(graph) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{minimum.size.separators()} was renamed to \code{min_separators()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/stCuts.Rd b/man/stCuts.Rd new file mode 100644 index 00000000000..6dbf7b81658 --- /dev/null +++ b/man/stCuts.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{stCuts} +\alias{stCuts} +\title{List all (s,t)-cuts of a graph} +\usage{ +stCuts(graph, source, target) +} +\arguments{ +\item{graph}{The input graph. It must be directed.} + +\item{source}{The source vertex.} + +\item{target}{The target vertex.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{stCuts()} was renamed to \code{st_cuts()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/stMincuts.Rd b/man/stMincuts.Rd new file mode 100644 index 00000000000..4300849e0c8 --- /dev/null +++ b/man/stMincuts.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{stMincuts} +\alias{stMincuts} +\title{List all minimum \((s,t)\)-cuts of a graph} +\usage{ +stMincuts(graph, source, target, capacity = NULL) +} +\arguments{ +\item{graph}{The input graph. It must be directed.} + +\item{source}{The id of the source vertex.} + +\item{target}{The id of the target vertex.} + +\item{capacity}{Numeric vector giving the edge capacities. If this is +\code{NULL} and the graph has a \code{weight} edge attribute, then this +attribute defines the edge capacities. For forcing unit edge capacities, +even for graphs that have a \code{weight} edge attribute, supply \code{NA} +here.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{stMincuts()} was renamed to \code{st_min_cuts()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/st_cuts.Rd b/man/st_cuts.Rd index aa64d6fcf0a..fa62bed723c 100644 --- a/man/st_cuts.Rd +++ b/man/st_cuts.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{st_cuts} \alias{st_cuts} -\alias{stCuts} \title{List all (s,t)-cuts of a graph} \usage{ st_cuts(graph, source, target) diff --git a/man/st_min_cuts.Rd b/man/st_min_cuts.Rd index 9faffb97551..deeed19ba77 100644 --- a/man/st_min_cuts.Rd +++ b/man/st_min_cuts.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/flow.R \name{st_min_cuts} \alias{st_min_cuts} -\alias{stMincuts} \title{List all minimum \eqn{(s,t)}-cuts of a graph} \usage{ st_min_cuts(graph, source, target, capacity = NULL) diff --git a/man/vertex.connectivity.Rd b/man/vertex.connectivity.Rd new file mode 100644 index 00000000000..b4dd0a34a01 --- /dev/null +++ b/man/vertex.connectivity.Rd @@ -0,0 +1,30 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{vertex.connectivity} +\alias{vertex.connectivity} +\title{Vertex connectivity} +\usage{ +vertex.connectivity(graph, source = NULL, target = NULL, checks = TRUE) +} +\arguments{ +\item{source}{The id of the source vertex, for \code{vertex_connectivity()} it +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{checks}{Logical constant. 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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{vertex.connectivity()} was renamed to \code{vertex_connectivity()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/vertex.disjoint.paths.Rd b/man/vertex.disjoint.paths.Rd new file mode 100644 index 00000000000..e3c6cf5f058 --- /dev/null +++ b/man/vertex.disjoint.paths.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/flow.R +\name{vertex.disjoint.paths} +\alias{vertex.disjoint.paths} +\title{Vertex connectivity} +\usage{ +vertex.disjoint.paths(graph, source = NULL, target = NULL) +} +\arguments{ +\item{source}{The id of the source vertex, for \code{vertex_connectivity()} it +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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{vertex.disjoint.paths()} was renamed to \code{vertex_disjoint_paths()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/vertex_connectivity.Rd b/man/vertex_connectivity.Rd index b8f42df7783..5fd50484fe7 100644 --- a/man/vertex_connectivity.Rd +++ b/man/vertex_connectivity.Rd @@ -2,10 +2,7 @@ % Please edit documentation in R/flow.R \name{vertex_connectivity} \alias{vertex_connectivity} -\alias{vertex.connectivity} -\alias{vertex.disjoint.paths} \alias{cohesion} -\alias{graph.cohesion} \alias{vertex_disjoint_paths} \alias{cohesion.igraph} \title{Vertex connectivity} From f4fbc1cdb372f26a5dd803fe46391ca0a1e28f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:01:04 +0100 Subject: [PATCH 23/48] refactor!: change R/foreign.R --- R/foreign.R | 54 +++++++++++++++++++++++++++++++------ man/graph.graphdb.Rd | 56 +++++++++++++++++++++++++++++++++++++++ man/graph_from_graphdb.Rd | 1 - man/read.graph.Rd | 33 +++++++++++++++++++++++ man/read_graph.Rd | 1 - man/write.graph.Rd | 34 ++++++++++++++++++++++++ man/write_graph.Rd | 1 - 7 files changed, 169 insertions(+), 11 deletions(-) create mode 100644 man/graph.graphdb.Rd create mode 100644 man/read.graph.Rd create mode 100644 man/write.graph.Rd diff --git a/R/foreign.R b/R/foreign.R index 14bd9ac1bfe..e877d6d8d3e 100644 --- a/R/foreign.R +++ b/R/foreign.R @@ -1,3 +1,48 @@ + +#' Writing the graph to a file in some format +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `write.graph()` was renamed to `write_graph()` to create a more +#' consistent API. +#' @inheritParams write_graph +#' @keywords internal +#' @export +write.graph <- function(graph , file , format = c("edgelist","pajek","ncol","lgl","graphml","dimacs","gml","dot","leda") , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "write.graph()", "write_graph()") + write_graph(graph = graph, file = file, format = format, ...) +} # nocov end + +#' Reading foreign file formats +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `read.graph()` was renamed to `read_graph()` to create a more +#' consistent API. +#' @inheritParams read_graph +#' @keywords internal +#' @export +read.graph <- function(file , format = c("edgelist","pajek","ncol","lgl","graphml","dimacs","graphdb","gml","dl") , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "read.graph()", "read_graph()") + read_graph(file = file, format = format, ...) +} # nocov end + +#' Load a graph from the graph database for testing graph isomorphism. +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.graphdb()` was renamed to `graph_from_graphdb()` to create a more +#' consistent API. +#' @inheritParams graph_from_graphdb +#' @keywords internal +#' @export +graph.graphdb <- function(url = NULL , prefix = "iso" , type = "r001" , nodes = NULL , pair = "A" , which = 0 , base = "http://cneurocvs.rmki.kfki.hu/graphdb/gzip" , compressed = TRUE , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.graphdb()", "graph_from_graphdb()") + graph_from_graphdb(url = url, prefix = prefix, type = type, nodes = nodes, pair = pair, which = which, base = base, compressed = compressed, directed = directed) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -76,7 +121,7 @@ write.graph.fromraw <- function(buffer, file) { #' the file format (the `format` argument). See the details separately for #' each file format, below. #' -#' @aliases read.graph LGL Pajek GraphML GML DL UCINET +#' @aliases LGL Pajek GraphML GML DL UCINET #' @param file The connection to read from. This can be a local file, or a #' `http` or `ftp` connection. It can also be a character string with #' the file name or URI. @@ -141,7 +186,6 @@ read_graph <- function(file, format = c( #' `write_graph()` is a general function for exporting graphs to foreign #' file formats, however not many formats are implemented right now. #' -#' @aliases write.graph #' @param graph The graph to export. #' @param file A connection or a string giving the file name to write the graph #' to. @@ -480,7 +524,6 @@ write.graph.dot <- function(graph, file, ...) { #' #' for the actual format of a graph database file and other information. #' -#' @aliases graph.graphdb #' @param url If not `NULL` it is a complete URL with the file to import. #' @param prefix Gives the prefix. See details below. Possible values: #' `iso`, `i2`, `si4`, `si6`, `mcs10`, `mcs30`, @@ -601,8 +644,3 @@ write.graph.leda <- function(graph, file, vertex.attr = NULL, edge.attr = NULL, .Call(R_igraph_write_graph_leda, graph, file, vertex.attr, edge.attr) } #' @export graph.graphdb -deprecated("graph.graphdb", graph_from_graphdb) -#' @export read.graph -deprecated("read.graph", read_graph) -#' @export write.graph -deprecated("write.graph", write_graph) diff --git a/man/graph.graphdb.Rd b/man/graph.graphdb.Rd new file mode 100644 index 00000000000..9f5b4ce278c --- /dev/null +++ b/man/graph.graphdb.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/foreign.R +\name{graph.graphdb} +\alias{graph.graphdb} +\title{Load a graph from the graph database for testing graph isomorphism.} +\usage{ +graph.graphdb( + url = NULL, + prefix = "iso", + type = "r001", + nodes = NULL, + pair = "A", + which = 0, + base = "http://cneurocvs.rmki.kfki.hu/graphdb/gzip", + compressed = TRUE, + directed = TRUE +) +} +\arguments{ +\item{url}{If not \code{NULL} it is a complete URL with the file to import.} + +\item{prefix}{Gives the prefix. See details below. Possible values: +\code{iso}, \code{i2}, \code{si4}, \code{si6}, \code{mcs10}, \code{mcs30}, +\code{mcs50}, \code{mcs70}, \code{mcs90}.} + +\item{type}{Gives the graph type identifier. See details below. Possible +values: \code{r001}, \code{r005}, \code{r01}, \code{r02}, \code{m2D}, +\code{m2Dr2}, \code{m2Dr4}, \code{m2Dr6} \code{m3D}, \code{m3Dr2}, +\code{m3Dr4}, \code{m3Dr6}, \code{m4D}, \code{m4Dr2}, \code{m4Dr4}, +\code{m4Dr6}, \code{b03}, \code{b03m}, \code{b06}, \code{b06m}, \code{b09}, +\code{b09m}.} + +\item{nodes}{The number of vertices in the graph.} + +\item{pair}{Specifies which graph of the pair to read. Possible values: +\code{A} and \code{B}.} + +\item{which}{Gives the number of the graph to read. For every graph type +there are a number of actual graphs in the database. This argument specifies +which one to read.} + +\item{base}{The base address of the database. See details below.} + +\item{compressed}{Logical constant, if TRUE than the file is expected to be +compressed by gzip. If \code{url} is \code{NULL} then a \sQuote{\code{.gz}} +suffix is added to the filename.} + +\item{directed}{Logical constant, whether to create a directed graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.graphdb()} was renamed to \code{graph_from_graphdb()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_graphdb.Rd b/man/graph_from_graphdb.Rd index 77824ec73e8..68fec588512 100644 --- a/man/graph_from_graphdb.Rd +++ b/man/graph_from_graphdb.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/foreign.R \name{graph_from_graphdb} \alias{graph_from_graphdb} -\alias{graph.graphdb} \title{Load a graph from the graph database for testing graph isomorphism.} \usage{ graph_from_graphdb( diff --git a/man/read.graph.Rd b/man/read.graph.Rd new file mode 100644 index 00000000000..57e9fb642f3 --- /dev/null +++ b/man/read.graph.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/foreign.R +\name{read.graph} +\alias{read.graph} +\title{Reading foreign file formats} +\usage{ +read.graph( + file, + format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "graphdb", "gml", + "dl"), + ... +) +} +\arguments{ +\item{file}{The connection to read from. This can be a local file, or a +\code{http} or \code{ftp} connection. It can also be a character string with +the file name or URI.} + +\item{format}{Character constant giving the file format. Right now +\code{edgelist}, \code{pajek}, \code{ncol}, \code{lgl}, \code{graphml}, +\code{dimacs}, \code{graphdb}, \code{gml} and \code{dl} are supported, +the default is \code{edgelist}. As of igraph 0.4 this argument is case +insensitive.} + +\item{...}{Additional arguments, see below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{read.graph()} was renamed to \code{read_graph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/read_graph.Rd b/man/read_graph.Rd index 7a84f549561..6cb6ec0b9a6 100644 --- a/man/read_graph.Rd +++ b/man/read_graph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/foreign.R \name{read_graph} \alias{read_graph} -\alias{read.graph} \alias{LGL} \alias{Pajek} \alias{GraphML} diff --git a/man/write.graph.Rd b/man/write.graph.Rd new file mode 100644 index 00000000000..75798fb66c9 --- /dev/null +++ b/man/write.graph.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/foreign.R +\name{write.graph} +\alias{write.graph} +\title{Writing the graph to a file in some format} +\usage{ +write.graph( + graph, + file, + format = c("edgelist", "pajek", "ncol", "lgl", "graphml", "dimacs", "gml", "dot", + "leda"), + ... +) +} +\arguments{ +\item{graph}{The graph to export.} + +\item{file}{A connection or a string giving the file name to write the graph +to.} + +\item{format}{Character string giving the file format. Right now +\code{pajek}, \code{graphml}, \code{dot}, \code{gml}, \code{edgelist}, +\code{lgl}, \code{ncol} and \code{dimacs} are implemented. As of igraph 0.4 +this argument is case insensitive.} + +\item{...}{Other, format specific arguments, see below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{write.graph()} was renamed to \code{write_graph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/write_graph.Rd b/man/write_graph.Rd index f5c98829700..891d8b06c1c 100644 --- a/man/write_graph.Rd +++ b/man/write_graph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/foreign.R \name{write_graph} \alias{write_graph} -\alias{write.graph} \title{Writing the graph to a file in some format} \usage{ write_graph( From 6ee5cf1908acd0cfc94ed6d80f6bc3949b28a708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:01:42 +0100 Subject: [PATCH 24/48] refactor!: change R/games.R --- R/games.R | 423 ++++++++++++++++++++++++----- man/aging.ba.game.Rd | 74 +++++ man/aging.barabasi.game.Rd | 74 +++++ man/aging.prefatt.game.Rd | 74 +++++ man/asymmetric.preference.game.Rd | 35 +++ man/ba.game.Rd | 73 +++++ man/barabasi.game.Rd | 73 +++++ man/bipartite.random.game.Rd | 48 ++++ man/callaway.traits.game.Rd | 37 +++ man/cited.type.game.Rd | 39 +++ man/citing.cited.type.game.Rd | 39 +++ man/connect.neighborhood.Rd | 28 ++ man/degree.sequence.game.Rd | 32 +++ man/establishment.game.Rd | 37 +++ man/forest.fire.game.Rd | 27 ++ man/grg.game.Rd | 26 ++ man/growing.random.game.Rd | 25 ++ man/interconnected.islands.game.Rd | 25 ++ man/k.regular.game.Rd | 26 ++ man/lastcit.game.Rd | 34 +++ man/preference.game.Rd | 44 +++ man/sample_bipartite.Rd | 1 - man/sample_degseq.Rd | 1 - man/sample_fitness.Rd | 1 - man/sample_fitness_pl.Rd | 1 - man/sample_forestfire.Rd | 1 - man/sample_grg.Rd | 1 - man/sample_growing.Rd | 1 - man/sample_islands.Rd | 1 - man/sample_k_regular.Rd | 1 - man/sample_last_cit.Rd | 3 - man/sample_pa.Rd | 2 - man/sample_pa_age.Rd | 3 - man/sample_pref.Rd | 2 - man/sample_sbm.Rd | 1 - man/sample_smallworld.Rd | 1 - man/sample_traits_callaway.Rd | 2 - man/sbm.game.Rd | 31 +++ man/static.fitness.game.Rd | 39 +++ man/static.power.law.game.Rd | 47 ++++ man/watts.strogatz.game.Rd | 31 +++ 41 files changed, 1378 insertions(+), 86 deletions(-) create mode 100644 man/aging.ba.game.Rd create mode 100644 man/aging.barabasi.game.Rd create mode 100644 man/aging.prefatt.game.Rd create mode 100644 man/asymmetric.preference.game.Rd create mode 100644 man/ba.game.Rd create mode 100644 man/barabasi.game.Rd create mode 100644 man/bipartite.random.game.Rd create mode 100644 man/callaway.traits.game.Rd create mode 100644 man/cited.type.game.Rd create mode 100644 man/citing.cited.type.game.Rd create mode 100644 man/connect.neighborhood.Rd create mode 100644 man/degree.sequence.game.Rd create mode 100644 man/establishment.game.Rd create mode 100644 man/forest.fire.game.Rd create mode 100644 man/grg.game.Rd create mode 100644 man/growing.random.game.Rd create mode 100644 man/interconnected.islands.game.Rd create mode 100644 man/k.regular.game.Rd create mode 100644 man/lastcit.game.Rd create mode 100644 man/preference.game.Rd create mode 100644 man/sbm.game.Rd create mode 100644 man/static.fitness.game.Rd create mode 100644 man/static.power.law.game.Rd create mode 100644 man/watts.strogatz.game.Rd diff --git a/R/games.R b/R/games.R index 9697aa32da8..db188a1cf9e 100644 --- a/R/games.R +++ b/R/games.R @@ -1,4 +1,364 @@ +#' The Watts-Strogatz small-world model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `watts.strogatz.game()` was renamed to `sample_smallworld()` to create a more +#' consistent API. +#' @inheritParams sample_smallworld +#' @keywords internal +#' @export +watts.strogatz.game <- function(dim , size , nei , p , loops = FALSE , multiple = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "watts.strogatz.game()", "sample_smallworld()") + sample_smallworld(dim = dim, size = size, nei = nei, p = p, loops = loops, multiple = multiple) +} # nocov end + +#' Scale-free random graphs, from vertex fitness scores +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `static.power.law.game()` was renamed to `sample_fitness_pl()` to create a more +#' consistent API. +#' @inheritParams sample_fitness_pl +#' @keywords internal +#' @export +static.power.law.game <- function(no.of.nodes , no.of.edges , exponent.out , exponent.in = -1 , loops = FALSE , multiple = FALSE , finite.size.correction = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "static.power.law.game()", "sample_fitness_pl()") + sample_fitness_pl(no.of.nodes = no.of.nodes, no.of.edges = no.of.edges, exponent.out = exponent.out, exponent.in = exponent.in, loops = loops, multiple = multiple, finite.size.correction = finite.size.correction) +} # nocov end + +#' Random graphs from vertex fitness scores +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `static.fitness.game()` was renamed to `sample_fitness()` to create a more +#' consistent API. +#' @inheritParams sample_fitness +#' @keywords internal +#' @export +static.fitness.game <- function(no.of.edges , fitness.out , fitness.in = NULL , loops = FALSE , multiple = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "static.fitness.game()", "sample_fitness()") + sample_fitness(no.of.edges = no.of.edges, fitness.out = fitness.out, fitness.in = fitness.in, loops = loops, multiple = multiple) +} # nocov end + +#' Sample stochastic block model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `sbm.game()` was renamed to `sample_sbm()` to create a more +#' consistent API. +#' @inheritParams sample_sbm +#' @keywords internal +#' @export +sbm.game <- function(n , pref.matrix , block.sizes , directed = FALSE , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "sbm.game()", "sample_sbm()") + sample_sbm(n = n, pref.matrix = pref.matrix, block.sizes = block.sizes, directed = directed, loops = loops) +} # nocov end + +#' Trait-based random generation +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `preference.game()` was renamed to `sample_pref()` to create a more +#' consistent API. +#' @inheritParams sample_pref +#' @keywords internal +#' @export +preference.game <- function(nodes , types , type.dist = rep(1,types) , fixed.sizes = FALSE , pref.matrix = matrix(1,types,types) , directed = FALSE , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "preference.game()", "sample_pref()") + sample_pref(nodes = nodes, types = types, type.dist = type.dist, fixed.sizes = fixed.sizes, pref.matrix = pref.matrix, directed = directed, loops = loops) +} # nocov end + +#' Random citation graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `lastcit.game()` was renamed to `sample_last_cit()` to create a more +#' consistent API. +#' @inheritParams sample_last_cit +#' @keywords internal +#' @export +lastcit.game <- function(n , edges = 1 , agebins = n/7100 , pref = (1:(agebins+1))^-3 , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "lastcit.game()", "sample_last_cit()") + sample_last_cit(n = n, edges = edges, agebins = agebins, pref = pref, directed = directed) +} # nocov end + +#' Create a random regular graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `k.regular.game()` was renamed to `sample_k_regular()` to create a more +#' consistent API. +#' @inheritParams sample_k_regular +#' @keywords internal +#' @export +k.regular.game <- function(no.of.nodes , k , directed = FALSE , multiple = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "k.regular.game()", "sample_k_regular()") + sample_k_regular(no.of.nodes = no.of.nodes, k = k, directed = directed, multiple = multiple) +} # nocov end + +#' A graph with subgraphs that are each a random graph. +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `interconnected.islands.game()` was renamed to `sample_islands()` to create a more +#' consistent API. +#' @inheritParams sample_islands +#' @keywords internal +#' @export +interconnected.islands.game <- function(islands.n , islands.size , islands.pin , n.inter) { # nocov start + lifecycle::deprecate_soft("1.6.0", "interconnected.islands.game()", "sample_islands()") + sample_islands(islands.n = islands.n, islands.size = islands.size, islands.pin = islands.pin, n.inter = n.inter) +} # nocov end + +#' Geometric random graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `grg.game()` was renamed to `sample_grg()` to create a more +#' consistent API. +#' @inheritParams sample_grg +#' @keywords internal +#' @export +grg.game <- function(nodes , radius , torus = FALSE , coords = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "grg.game()", "sample_grg()") + sample_grg(nodes = nodes, radius = radius, torus = torus, coords = coords) +} # nocov end + +#' Growing random graph generation +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `growing.random.game()` was renamed to `sample_growing()` to create a more +#' consistent API. +#' @inheritParams sample_growing +#' @keywords internal +#' @export +growing.random.game <- function(n , m = 1 , directed = TRUE , citation = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "growing.random.game()", "sample_growing()") + sample_growing(n = n, m = m, directed = directed, citation = citation) +} # nocov end + +#' Forest Fire Network Model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `forest.fire.game()` was renamed to `sample_forestfire()` to create a more +#' consistent API. +#' @inheritParams sample_forestfire +#' @keywords internal +#' @export +forest.fire.game <- function(nodes , fw.prob , bw.factor = 1 , ambs = 1 , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "forest.fire.game()", "sample_forestfire()") + sample_forestfire(nodes = nodes, fw.prob = fw.prob, bw.factor = bw.factor, ambs = ambs, directed = directed) +} # nocov end + +#' Graph generation based on different vertex types +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `establishment.game()` was renamed to `sample_traits()` to create a more +#' consistent API. +#' @inheritParams sample_traits +#' @keywords internal +#' @export +establishment.game <- function(nodes , types , k = 1 , type.dist = rep(1,types) , pref.matrix = matrix(1,types,types) , directed = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "establishment.game()", "sample_traits()") + sample_traits(nodes = nodes, types = types, k = k, type.dist = type.dist, pref.matrix = pref.matrix, directed = directed) +} # nocov end + +#' Generate random graphs with a given degree sequence +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `degree.sequence.game()` was renamed to `sample_degseq()` to create a more +#' consistent API. +#' @inheritParams sample_degseq +#' @keywords internal +#' @export +degree.sequence.game <- function(out.deg , in.deg = NULL , method = c("simple","vl","simple.no.multiple","simple.no.multiple.uniform")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "degree.sequence.game()", "sample_degseq()") + sample_degseq(out.deg = out.deg, in.deg = in.deg, method = method) +} # nocov end + +#' Neighborhood of graph vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `connect.neighborhood()` was renamed to `connect()` to create a more +#' consistent API. +#' @inheritParams connect +#' @keywords internal +#' @export +connect.neighborhood <- function(graph , order , mode = c("all","out","in","total")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "connect.neighborhood()", "connect()") + connect(graph = graph, order = order, mode = mode) +} # nocov end + +#' Random citation graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `citing.cited.type.game()` was renamed to `sample_cit_cit_types()` to create a more +#' consistent API. +#' @inheritParams sample_cit_cit_types +#' @keywords internal +#' @export +citing.cited.type.game <- function(n , edges = 1 , types = rep(0,n) , pref = matrix(1,nrow=length(types),ncol=length(types)) , directed = TRUE , attr = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "citing.cited.type.game()", "sample_cit_cit_types()") + sample_cit_cit_types(n = n, edges = edges, types = types, pref = pref, directed = directed, attr = attr) +} # nocov end + +#' Random citation graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `cited.type.game()` was renamed to `sample_cit_types()` to create a more +#' consistent API. +#' @inheritParams sample_cit_types +#' @keywords internal +#' @export +cited.type.game <- function(n , edges = 1 , types = rep(0,n) , pref = rep(1,length(types)) , directed = TRUE , attr = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "cited.type.game()", "sample_cit_types()") + sample_cit_types(n = n, edges = edges, types = types, pref = pref, directed = directed, attr = attr) +} # nocov end + +#' Graph generation based on different vertex types +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `callaway.traits.game()` was renamed to `sample_traits_callaway()` to create a more +#' consistent API. +#' @inheritParams sample_traits_callaway +#' @keywords internal +#' @export +callaway.traits.game <- function(nodes , types , edge.per.step = 1 , type.dist = rep(1,types) , pref.matrix = matrix(1,types,types) , directed = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "callaway.traits.game()", "sample_traits_callaway()") + sample_traits_callaway(nodes = nodes, types = types, edge.per.step = edge.per.step, type.dist = type.dist, pref.matrix = pref.matrix, directed = directed) +} # nocov end + +#' Bipartite random graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `bipartite.random.game()` was renamed to `sample_bipartite()` to create a more +#' consistent API. +#' @inheritParams sample_bipartite +#' @keywords internal +#' @export +bipartite.random.game <- function(n1 , n2 , type = c("gnp","gnm") , p , m , directed = FALSE , mode = c("out","in","all")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "bipartite.random.game()", "sample_bipartite()") + sample_bipartite(n1 = n1, n2 = n2, type = type, p = p, m = m, directed = directed, mode = mode) +} # nocov end + +#' Generate random graphs using preferential attachment +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `barabasi.game()` was renamed to `sample_pa()` to create a more +#' consistent API. +#' @inheritParams sample_pa +#' @keywords internal +#' @export +barabasi.game <- function(n , power = 1 , m = NULL , out.dist = NULL , out.seq = NULL , out.pref = FALSE , zero.appeal = 1 , directed = TRUE , algorithm = c("psumtree","psumtree-multiple","bag") , start.graph = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "barabasi.game()", "sample_pa()") + sample_pa(n = n, power = power, m = m, out.dist = out.dist, out.seq = out.seq, out.pref = out.pref, zero.appeal = zero.appeal, directed = directed, algorithm = algorithm, start.graph = start.graph) +} # nocov end + +#' Generate random graphs using preferential attachment +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `ba.game()` was renamed to `sample_pa()` to create a more +#' consistent API. +#' @inheritParams sample_pa +#' @keywords internal +#' @export +ba.game <- function(n , power = 1 , m = NULL , out.dist = NULL , out.seq = NULL , out.pref = FALSE , zero.appeal = 1 , directed = TRUE , algorithm = c("psumtree","psumtree-multiple","bag") , start.graph = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "ba.game()", "sample_pa()") + sample_pa(n = n, power = power, m = m, out.dist = out.dist, out.seq = out.seq, out.pref = out.pref, zero.appeal = zero.appeal, directed = directed, algorithm = algorithm, start.graph = start.graph) +} # nocov end + +#' Trait-based random generation +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `asymmetric.preference.game()` was renamed to `sample_asym_pref()` to create a more +#' consistent API. +#' @inheritParams sample_asym_pref +#' @keywords internal +#' @export +asymmetric.preference.game <- function(nodes , types , type.dist.matrix = matrix(1,types,types) , pref.matrix = matrix(1,types,types) , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "asymmetric.preference.game()", "sample_asym_pref()") + sample_asym_pref(nodes = nodes, types = types, type.dist.matrix = type.dist.matrix, pref.matrix = pref.matrix, loops = loops) +} # nocov end + +#' Generate an evolving random graph with preferential attachment and aging +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `aging.barabasi.game()` was renamed to `sample_pa_age()` to create a more +#' consistent API. +#' @inheritParams sample_pa_age +#' @keywords internal +#' @export +aging.barabasi.game <- function(n , pa.exp , aging.exp , m = NULL , aging.bin = 300 , out.dist = NULL , out.seq = NULL , out.pref = FALSE , directed = TRUE , zero.deg.appeal = 1 , zero.age.appeal = 0 , deg.coef = 1 , age.coef = 1 , time.window = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "aging.barabasi.game()", "sample_pa_age()") + sample_pa_age(n = n, pa.exp = pa.exp, aging.exp = aging.exp, m = m, aging.bin = aging.bin, out.dist = out.dist, out.seq = out.seq, out.pref = out.pref, directed = directed, zero.deg.appeal = zero.deg.appeal, zero.age.appeal = zero.age.appeal, deg.coef = deg.coef, age.coef = age.coef, time.window = time.window) +} # nocov end + +#' Generate an evolving random graph with preferential attachment and aging +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `aging.ba.game()` was renamed to `sample_pa_age()` to create a more +#' consistent API. +#' @inheritParams sample_pa_age +#' @keywords internal +#' @export +aging.ba.game <- function(n , pa.exp , aging.exp , m = NULL , aging.bin = 300 , out.dist = NULL , out.seq = NULL , out.pref = FALSE , directed = TRUE , zero.deg.appeal = 1 , zero.age.appeal = 0 , deg.coef = 1 , age.coef = 1 , time.window = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "aging.ba.game()", "sample_pa_age()") + sample_pa_age(n = n, pa.exp = pa.exp, aging.exp = aging.exp, m = m, aging.bin = aging.bin, out.dist = out.dist, out.seq = out.seq, out.pref = out.pref, directed = directed, zero.deg.appeal = zero.deg.appeal, zero.age.appeal = zero.age.appeal, deg.coef = deg.coef, age.coef = age.coef, time.window = time.window) +} # nocov end + +#' Generate an evolving random graph with preferential attachment and aging +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `aging.prefatt.game()` was renamed to `sample_pa_age()` to create a more +#' consistent API. +#' @inheritParams sample_pa_age +#' @keywords internal +#' @export +aging.prefatt.game <- function(n , pa.exp , aging.exp , m = NULL , aging.bin = 300 , out.dist = NULL , out.seq = NULL , out.pref = FALSE , directed = TRUE , zero.deg.appeal = 1 , zero.age.appeal = 0 , deg.coef = 1 , age.coef = 1 , time.window = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "aging.prefatt.game()", "sample_pa_age()") + sample_pa_age(n = n, pa.exp = pa.exp, aging.exp = aging.exp, m = m, aging.bin = aging.bin, out.dist = out.dist, out.seq = out.seq, out.pref = out.pref, directed = directed, zero.deg.appeal = zero.deg.appeal, zero.age.appeal = zero.age.appeal, deg.coef = deg.coef, age.coef = age.coef, time.window = time.window) +} # nocov end + ## ----------------------------------------------------------------- ## IGraph R package ## Copyright (C) 2005-2014 Gabor Csardi @@ -61,7 +421,6 @@ #' (in- + out-) degree of the vertex, unless the `out.pref` argument is set to #' `TRUE`. #' -#' @aliases barabasi.game ba.game #' @param n Number of vertices. #' @param power The power of the preferential attachment, the default is one, #' i.e. linear preferential attachment. @@ -426,7 +785,6 @@ random.graph.game <- erdos.renyi.game #' algorithm is used to randomize the graph. The \dQuote{vl} samples from the #' undirected, connected simple graphs uniformly. #' -#' @aliases degree.sequence.game #' @param out.deg Numeric vector, the sequence of degrees (for undirected #' graphs) or out-degrees (for directed graphs). For undirected graphs its sum #' should be even. For directed graphs its sum should be the same as the sum of @@ -525,7 +883,6 @@ degseq <- function(..., deterministic = FALSE) { #' vertices, otherwise the edges are connecting new vertex to uniformly #' randomly chosen old vertices. #' -#' @aliases growing.random.game #' @param n Numeric constant, number of vertices in the graph. #' @param m Numeric constant, number of edges added in each time step. #' @param directed Logical, whether to create a directed graph. @@ -615,7 +972,6 @@ growing <- function(...) constructor_spec(sample_growing, ...) #' #' This function might generate graphs with multiple edges. #' -#' @aliases aging.prefatt.game aging.barabasi.game aging.ba.game #' @param n The number of vertices in the graph. #' @param pa.exp The preferential attachment exponent, see the details below. #' @param aging.exp The exponent of the aging, usually a non-positive number, @@ -782,7 +1138,6 @@ pa_age <- function(...) constructor_spec(sample_pa_age, ...) #' depends on the types of the vertices involved and is taken from #' `pref.matrix`. #' -#' @aliases callaway.traits.game establishment.game #' @param nodes 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. @@ -871,7 +1226,6 @@ 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. #' -#' @aliases grg.game #' @param nodes The number of vertices in the graph. #' @param radius The radius within which the vertices will be connected by an #' edge. @@ -939,7 +1293,6 @@ grg <- function(...) constructor_spec(sample_grg, ...) #' `type` vertex attribute for `sample_pref()` and from the #' `intype` and `outtype` vertex attribute for `sample_asym_pref()`. #' -#' @aliases preference.game asymmetric.preference.game #' @param nodes 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 @@ -1092,7 +1445,6 @@ connect <- function(graph, order, mode = c("all", "out", "in", "total")) { #' simultaneously having short path lengths and high clustering. #' #' -#' @aliases watts.strogatz.game #' @param dim Integer constant, the dimension of the starting lattice. #' @param size Integer constant, the size of the lattice along each dimension. #' @param nei Integer constant, the neighborhood within which the vertices of @@ -1157,7 +1509,6 @@ smallworld <- function(...) constructor_spec(sample_smallworld, ...) #' but the probability of an edge depends on the (potentially) cited #' vertex only. #' -#' @aliases cited.type.game citing.cited.type.game lastcit.game #' @param n Number of vertices. #' @param edges Number of edges per step. #' @param agebins Number of aging bins. @@ -1261,7 +1612,6 @@ cit_cit_types <- function(...) constructor_spec(sample_cit_cit_types, ...) #' with probability \eqn{p}, independently of the rest of the edges. In \eqn{G(n,m)}, we #' uniformly choose \eqn{m} edges to realize. #' -#' @aliases bipartite.random.game #' @param n1 Integer scalar, the number of bottom vertices. #' @param n2 Integer scalar, the number of top vertices. #' @param type Character scalar, the type of the graph, \sQuote{gnp} creates a @@ -1362,7 +1712,6 @@ bipartite <- function(...) constructor_spec(sample_bipartite, ...) #' The order of the vertices in the generated graph corresponds to the #' `block.sizes` argument. #' -#' @aliases sbm.game #' @param n Number of vertices in the graph. #' @param pref.matrix The matrix giving the Bernoulli rates. This is a #' \eqn{K\times K}{KxK} matrix, where \eqn{K} is the number of groups. The @@ -1532,7 +1881,6 @@ dot_product <- function(...) constructor_spec(sample_dot_product, ...) #' oc #' } #' -#' @aliases interconnected.islands.game #' @param islands.n The number of islands in the graph. #' @param islands.size The size of islands in the graph. #' @param islands.pin The probability to create each possible edge into each @@ -1558,7 +1906,6 @@ sample_islands <- simple_interconnected_islands_game_impl #' The game simply uses [sample_degseq()] with appropriately #' constructed degree sequences. #' -#' @aliases k.regular.game #' @param no.of.nodes Integer scalar, the number of vertices in the generated #' graph. #' @param k Integer scalar, the degree of each vertex in the graph, or the @@ -1618,7 +1965,6 @@ sample_k_regular <- k_regular_game_impl #' distribution. Alternatively, you may use [sample_fitness_pl()] #' which generates the fitnesses for you with a given exponent. #' -#' @aliases static.fitness.game #' @param no.of.edges The number of edges in the generated graph. #' @param fitness.out A numeric vector containing the fitness of each vertex. #' For directed graphs, this specifies the out-fitness of each vertex. @@ -1676,7 +2022,6 @@ sample_fitness <- static_fitness_game_impl #' the square root of the number of edges times the average degree; see the #' paper of Chung and Lu, and Cho et al for more details. #' -#' @aliases static.power.law.game #' @param no.of.nodes The number of vertices in the generated graph. #' @param no.of.edges The number of edges in the generated graph. #' @param exponent.out Numeric scalar, the power law exponent of the degree @@ -1739,7 +2084,6 @@ sample_fitness_pl <- static_power_law_game_impl #' available then we cite all of them. \item The same procedure is applied to #' all the newly cited vertices. } #' -#' @aliases forest.fire.game #' @param nodes 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 @@ -1848,50 +2192,3 @@ sample_correlated_gnp <- correlated_game_impl #' cor(as.vector(gg[[1]][]), as.vector(gg[[2]][])) sample_correlated_gnp_pair <- correlated_pair_game_impl #' @export aging.prefatt.game -deprecated("aging.prefatt.game", sample_pa_age) -#' @export aging.ba.game -deprecated("aging.ba.game", sample_pa_age) -#' @export aging.barabasi.game -deprecated("aging.barabasi.game", sample_pa_age) -#' @export asymmetric.preference.game -deprecated("asymmetric.preference.game", sample_asym_pref) -#' @export ba.game -deprecated("ba.game", sample_pa) -#' @export barabasi.game -deprecated("barabasi.game", sample_pa) -#' @export bipartite.random.game -deprecated("bipartite.random.game", sample_bipartite) -#' @export callaway.traits.game -deprecated("callaway.traits.game", sample_traits_callaway) -#' @export cited.type.game -deprecated("cited.type.game", sample_cit_types) -#' @export citing.cited.type.game -deprecated("citing.cited.type.game", sample_cit_cit_types) -#' @export connect.neighborhood -deprecated("connect.neighborhood", connect) -#' @export degree.sequence.game -deprecated("degree.sequence.game", sample_degseq) -#' @export establishment.game -deprecated("establishment.game", sample_traits) -#' @export forest.fire.game -deprecated("forest.fire.game", sample_forestfire) -#' @export growing.random.game -deprecated("growing.random.game", sample_growing) -#' @export grg.game -deprecated("grg.game", sample_grg) -#' @export interconnected.islands.game -deprecated("interconnected.islands.game", sample_islands) -#' @export k.regular.game -deprecated("k.regular.game", sample_k_regular) -#' @export lastcit.game -deprecated("lastcit.game", sample_last_cit) -#' @export preference.game -deprecated("preference.game", sample_pref) -#' @export sbm.game -deprecated("sbm.game", sample_sbm) -#' @export static.fitness.game -deprecated("static.fitness.game", sample_fitness) -#' @export static.power.law.game -deprecated("static.power.law.game", sample_fitness_pl) -#' @export watts.strogatz.game -deprecated("watts.strogatz.game", sample_smallworld) diff --git a/man/aging.ba.game.Rd b/man/aging.ba.game.Rd new file mode 100644 index 00000000000..bec871f51d1 --- /dev/null +++ b/man/aging.ba.game.Rd @@ -0,0 +1,74 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{aging.ba.game} +\alias{aging.ba.game} +\title{Generate an evolving random graph with preferential attachment and aging} +\usage{ +aging.ba.game( + n, + pa.exp, + aging.exp, + m = NULL, + aging.bin = 300, + out.dist = NULL, + out.seq = NULL, + out.pref = FALSE, + directed = TRUE, + zero.deg.appeal = 1, + zero.age.appeal = 0, + deg.coef = 1, + age.coef = 1, + time.window = NULL +) +} +\arguments{ +\item{n}{The number of vertices in the graph.} + +\item{pa.exp}{The preferential attachment exponent, see the details below.} + +\item{aging.exp}{The exponent of the aging, usually a non-positive number, +see details below.} + +\item{m}{The number of edges each new vertex creates (except the very first +vertex). This argument is used only if both the \code{out.dist} and +\code{out.seq} arguments are NULL.} + +\item{aging.bin}{The number of bins to use for measuring the age of +vertices, see details below.} + +\item{out.dist}{The discrete distribution to generate the number of edges to +add in each time step if \code{out.seq} is NULL. See details below.} + +\item{out.seq}{The number of edges to add in each time step, a vector +containing as many elements as the number of vertices. See details below.} + +\item{out.pref}{Logical constant, whether to include edges not initiated by +the vertex as a basis of preferential attachment. See details below.} + +\item{directed}{Logical constant, whether to generate a directed graph. See +details below.} + +\item{zero.deg.appeal}{The degree-dependent part of the +\sQuote{attractiveness} of the vertices with no adjacent edges. See also +details below.} + +\item{zero.age.appeal}{The age-dependent part of the \sQuote{attrativeness} +of the vertices with age zero. It is usually zero, see details below.} + +\item{deg.coef}{The coefficient of the degree-dependent +\sQuote{attractiveness}. See details below.} + +\item{age.coef}{The coefficient of the age-dependent part of the +\sQuote{attractiveness}. See details below.} + +\item{time.window}{Integer constant, if NULL only adjacent added in the last +\code{time.windows} time steps are counted as a basis of the preferential +attachment. See also details below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{aging.ba.game()} was renamed to \code{sample_pa_age()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/aging.barabasi.game.Rd b/man/aging.barabasi.game.Rd new file mode 100644 index 00000000000..238f1a1d152 --- /dev/null +++ b/man/aging.barabasi.game.Rd @@ -0,0 +1,74 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{aging.barabasi.game} +\alias{aging.barabasi.game} +\title{Generate an evolving random graph with preferential attachment and aging} +\usage{ +aging.barabasi.game( + n, + pa.exp, + aging.exp, + m = NULL, + aging.bin = 300, + out.dist = NULL, + out.seq = NULL, + out.pref = FALSE, + directed = TRUE, + zero.deg.appeal = 1, + zero.age.appeal = 0, + deg.coef = 1, + age.coef = 1, + time.window = NULL +) +} +\arguments{ +\item{n}{The number of vertices in the graph.} + +\item{pa.exp}{The preferential attachment exponent, see the details below.} + +\item{aging.exp}{The exponent of the aging, usually a non-positive number, +see details below.} + +\item{m}{The number of edges each new vertex creates (except the very first +vertex). This argument is used only if both the \code{out.dist} and +\code{out.seq} arguments are NULL.} + +\item{aging.bin}{The number of bins to use for measuring the age of +vertices, see details below.} + +\item{out.dist}{The discrete distribution to generate the number of edges to +add in each time step if \code{out.seq} is NULL. See details below.} + +\item{out.seq}{The number of edges to add in each time step, a vector +containing as many elements as the number of vertices. See details below.} + +\item{out.pref}{Logical constant, whether to include edges not initiated by +the vertex as a basis of preferential attachment. See details below.} + +\item{directed}{Logical constant, whether to generate a directed graph. See +details below.} + +\item{zero.deg.appeal}{The degree-dependent part of the +\sQuote{attractiveness} of the vertices with no adjacent edges. See also +details below.} + +\item{zero.age.appeal}{The age-dependent part of the \sQuote{attrativeness} +of the vertices with age zero. It is usually zero, see details below.} + +\item{deg.coef}{The coefficient of the degree-dependent +\sQuote{attractiveness}. See details below.} + +\item{age.coef}{The coefficient of the age-dependent part of the +\sQuote{attractiveness}. See details below.} + +\item{time.window}{Integer constant, if NULL only adjacent added in the last +\code{time.windows} time steps are counted as a basis of the preferential +attachment. See also details below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{aging.barabasi.game()} was renamed to \code{sample_pa_age()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/aging.prefatt.game.Rd b/man/aging.prefatt.game.Rd new file mode 100644 index 00000000000..0ff7822cce5 --- /dev/null +++ b/man/aging.prefatt.game.Rd @@ -0,0 +1,74 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{aging.prefatt.game} +\alias{aging.prefatt.game} +\title{Generate an evolving random graph with preferential attachment and aging} +\usage{ +aging.prefatt.game( + n, + pa.exp, + aging.exp, + m = NULL, + aging.bin = 300, + out.dist = NULL, + out.seq = NULL, + out.pref = FALSE, + directed = TRUE, + zero.deg.appeal = 1, + zero.age.appeal = 0, + deg.coef = 1, + age.coef = 1, + time.window = NULL +) +} +\arguments{ +\item{n}{The number of vertices in the graph.} + +\item{pa.exp}{The preferential attachment exponent, see the details below.} + +\item{aging.exp}{The exponent of the aging, usually a non-positive number, +see details below.} + +\item{m}{The number of edges each new vertex creates (except the very first +vertex). This argument is used only if both the \code{out.dist} and +\code{out.seq} arguments are NULL.} + +\item{aging.bin}{The number of bins to use for measuring the age of +vertices, see details below.} + +\item{out.dist}{The discrete distribution to generate the number of edges to +add in each time step if \code{out.seq} is NULL. See details below.} + +\item{out.seq}{The number of edges to add in each time step, a vector +containing as many elements as the number of vertices. See details below.} + +\item{out.pref}{Logical constant, whether to include edges not initiated by +the vertex as a basis of preferential attachment. See details below.} + +\item{directed}{Logical constant, whether to generate a directed graph. See +details below.} + +\item{zero.deg.appeal}{The degree-dependent part of the +\sQuote{attractiveness} of the vertices with no adjacent edges. See also +details below.} + +\item{zero.age.appeal}{The age-dependent part of the \sQuote{attrativeness} +of the vertices with age zero. It is usually zero, see details below.} + +\item{deg.coef}{The coefficient of the degree-dependent +\sQuote{attractiveness}. See details below.} + +\item{age.coef}{The coefficient of the age-dependent part of the +\sQuote{attractiveness}. See details below.} + +\item{time.window}{Integer constant, if NULL only adjacent added in the last +\code{time.windows} time steps are counted as a basis of the preferential +attachment. See also details below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{aging.prefatt.game()} was renamed to \code{sample_pa_age()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/asymmetric.preference.game.Rd b/man/asymmetric.preference.game.Rd new file mode 100644 index 00000000000..2213cb9bb00 --- /dev/null +++ b/man/asymmetric.preference.game.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{asymmetric.preference.game} +\alias{asymmetric.preference.game} +\title{Trait-based random generation} +\usage{ +asymmetric.preference.game( + nodes, + types, + type.dist.matrix = matrix(1, types, types), + pref.matrix = matrix(1, types, types), + loops = FALSE +) +} +\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 +types.} + +\item{pref.matrix}{A square matrix giving the preferences of the vertex +types. The matrix has \sQuote{types} rows and columns. When generating +an undirected graph, it must be symmetric.} + +\item{loops}{Logical constant, whether self-loops are allowed in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{asymmetric.preference.game()} was renamed to \code{sample_asym_pref()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/ba.game.Rd b/man/ba.game.Rd new file mode 100644 index 00000000000..a60ce1509d1 --- /dev/null +++ b/man/ba.game.Rd @@ -0,0 +1,73 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{ba.game} +\alias{ba.game} +\title{Generate random graphs using preferential attachment} +\usage{ +ba.game( + n, + power = 1, + m = NULL, + out.dist = NULL, + out.seq = NULL, + out.pref = FALSE, + zero.appeal = 1, + directed = TRUE, + algorithm = c("psumtree", "psumtree-multiple", "bag"), + start.graph = NULL +) +} +\arguments{ +\item{n}{Number of vertices.} + +\item{power}{The power of the preferential attachment, the default is one, +i.e. linear preferential attachment.} + +\item{m}{Numeric constant, the number of edges to add in each time step This +argument is only used if both \code{out.dist} and \code{out.seq} are omitted +or NULL.} + +\item{out.dist}{Numeric vector, the distribution of the number of edges to +add in each time step. This argument is only used if the \code{out.seq} +argument is omitted or NULL.} + +\item{out.seq}{Numeric vector giving the number of edges to add in each time +step. Its first element is ignored as no edges are added in the first time +step.} + +\item{out.pref}{Logical, if true the total degree is used for calculating +the citation probability, otherwise the in-degree is used.} + +\item{zero.appeal}{The \sQuote{attractiveness} of the vertices with no +adjacent edges. See details below.} + +\item{directed}{Whether to create a directed graph.} + +\item{algorithm}{The algorithm to use for the graph generation. +\code{psumtree} uses a partial prefix-sum tree to generate the graph, this +algorithm can handle any \code{power} and \code{zero.appeal} values and +never generates multiple edges. \code{psumtree-multiple} also uses a +partial prefix-sum tree, but the generation of multiple edges is allowed. +Before the 0.6 version igraph used this algorithm if \code{power} was not +one, or \code{zero.appeal} was not one. \code{bag} is the algorithm that +was previously (before version 0.6) used if \code{power} was one and +\code{zero.appeal} was one as well. It works by putting the ids of the +vertices into a bag (multiset, really), exactly as many times as their +(in-)degree, plus once more. Then the required number of cited vertices are +drawn from the bag, with replacement. This method might generate multiple +edges. It only works if \code{power} and \code{zero.appeal} are equal one.} + +\item{start.graph}{\code{NULL} or an igraph graph. If a graph, then the +supplied graph is used as a starting graph for the preferential attachment +algorithm. The graph should have at least one vertex. If a graph is supplied +here and the \code{out.seq} argument is not \code{NULL}, then it should +contain the out degrees of the new vertices only, not the ones in the +\code{start.graph}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{ba.game()} was renamed to \code{sample_pa()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/barabasi.game.Rd b/man/barabasi.game.Rd new file mode 100644 index 00000000000..a2bf7321b9d --- /dev/null +++ b/man/barabasi.game.Rd @@ -0,0 +1,73 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{barabasi.game} +\alias{barabasi.game} +\title{Generate random graphs using preferential attachment} +\usage{ +barabasi.game( + n, + power = 1, + m = NULL, + out.dist = NULL, + out.seq = NULL, + out.pref = FALSE, + zero.appeal = 1, + directed = TRUE, + algorithm = c("psumtree", "psumtree-multiple", "bag"), + start.graph = NULL +) +} +\arguments{ +\item{n}{Number of vertices.} + +\item{power}{The power of the preferential attachment, the default is one, +i.e. linear preferential attachment.} + +\item{m}{Numeric constant, the number of edges to add in each time step This +argument is only used if both \code{out.dist} and \code{out.seq} are omitted +or NULL.} + +\item{out.dist}{Numeric vector, the distribution of the number of edges to +add in each time step. This argument is only used if the \code{out.seq} +argument is omitted or NULL.} + +\item{out.seq}{Numeric vector giving the number of edges to add in each time +step. Its first element is ignored as no edges are added in the first time +step.} + +\item{out.pref}{Logical, if true the total degree is used for calculating +the citation probability, otherwise the in-degree is used.} + +\item{zero.appeal}{The \sQuote{attractiveness} of the vertices with no +adjacent edges. See details below.} + +\item{directed}{Whether to create a directed graph.} + +\item{algorithm}{The algorithm to use for the graph generation. +\code{psumtree} uses a partial prefix-sum tree to generate the graph, this +algorithm can handle any \code{power} and \code{zero.appeal} values and +never generates multiple edges. \code{psumtree-multiple} also uses a +partial prefix-sum tree, but the generation of multiple edges is allowed. +Before the 0.6 version igraph used this algorithm if \code{power} was not +one, or \code{zero.appeal} was not one. \code{bag} is the algorithm that +was previously (before version 0.6) used if \code{power} was one and +\code{zero.appeal} was one as well. It works by putting the ids of the +vertices into a bag (multiset, really), exactly as many times as their +(in-)degree, plus once more. Then the required number of cited vertices are +drawn from the bag, with replacement. This method might generate multiple +edges. It only works if \code{power} and \code{zero.appeal} are equal one.} + +\item{start.graph}{\code{NULL} or an igraph graph. If a graph, then the +supplied graph is used as a starting graph for the preferential attachment +algorithm. The graph should have at least one vertex. If a graph is supplied +here and the \code{out.seq} argument is not \code{NULL}, then it should +contain the out degrees of the new vertices only, not the ones in the +\code{start.graph}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{barabasi.game()} was renamed to \code{sample_pa()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/bipartite.random.game.Rd b/man/bipartite.random.game.Rd new file mode 100644 index 00000000000..b21155f19e2 --- /dev/null +++ b/man/bipartite.random.game.Rd @@ -0,0 +1,48 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{bipartite.random.game} +\alias{bipartite.random.game} +\title{Bipartite random graphs} +\usage{ +bipartite.random.game( + n1, + n2, + type = c("gnp", "gnm"), + p, + m, + directed = FALSE, + mode = c("out", "in", "all") +) +} +\arguments{ +\item{n1}{Integer scalar, the number of bottom vertices.} + +\item{n2}{Integer scalar, the number of top vertices.} + +\item{type}{Character scalar, the type of the graph, \sQuote{gnp} creates a +\eqn{G(n,p)} graph, \sQuote{gnm} creates a \eqn{G(n,m)} graph. See details below.} + +\item{p}{Real scalar, connection probability for \eqn{G(n,p)} graphs. Should not +be given for \eqn{G(n,m)} graphs.} + +\item{m}{Integer scalar, the number of edges for \eqn{G(n,m)} graphs. Should not +be given for \eqn{G(n,p)} graphs.} + +\item{directed}{Logical scalar, whether to create a directed graph. See also +the \code{mode} argument.} + +\item{mode}{Character scalar, specifies how to direct the edges in directed +graphs. If it is \sQuote{out}, then directed edges point from bottom +vertices to top vertices. If it is \sQuote{in}, edges point from top +vertices to bottom vertices. \sQuote{out} and \sQuote{in} do not generate +mutual edges. If this argument is \sQuote{all}, then each edge direction is +considered independently and mutual edges might be generated. This argument +is ignored for undirected graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{bipartite.random.game()} was renamed to \code{sample_bipartite()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/callaway.traits.game.Rd b/man/callaway.traits.game.Rd new file mode 100644 index 00000000000..866f619da76 --- /dev/null +++ b/man/callaway.traits.game.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{callaway.traits.game} +\alias{callaway.traits.game} +\title{Graph generation based on different vertex types} +\usage{ +callaway.traits.game( + nodes, + types, + edge.per.step = 1, + type.dist = rep(1, types), + pref.matrix = matrix(1, types, types), + directed = FALSE +) +} +\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.} + +\item{type.dist}{The distribution of the vertex types. This is assumed to be +stationary in time.} + +\item{pref.matrix}{A matrix giving the preferences of the given vertex +types. These should be probabilities, i.e. numbers between zero and one.} + +\item{directed}{Logical constant, whether to generate directed graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{callaway.traits.game()} was renamed to \code{sample_traits_callaway()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/cited.type.game.Rd b/man/cited.type.game.Rd new file mode 100644 index 00000000000..68707d0354e --- /dev/null +++ b/man/cited.type.game.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{cited.type.game} +\alias{cited.type.game} +\title{Random citation graphs} +\usage{ +cited.type.game( + n, + edges = 1, + types = rep(0, n), + pref = rep(1, length(types)), + directed = TRUE, + attr = TRUE +) +} +\arguments{ +\item{n}{Number of vertices.} + +\item{edges}{Number of edges per step.} + +\item{types}{Vector of length \sQuote{\code{n}}, the types of the vertices. +Types are numbered from zero.} + +\item{pref}{Vector (\code{sample_last_cit()} and \code{sample_cit_types()} or +matrix (\code{sample_cit_cit_types()}) giving the (unnormalized) citation +probabilities for the different vertex types.} + +\item{directed}{Logical scalar, whether to generate directed networks.} + +\item{attr}{Logical scalar, whether to add the vertex types to the generated +graph as a vertex attribute called \sQuote{\code{type}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{cited.type.game()} was renamed to \code{sample_cit_types()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/citing.cited.type.game.Rd b/man/citing.cited.type.game.Rd new file mode 100644 index 00000000000..340244a335a --- /dev/null +++ b/man/citing.cited.type.game.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{citing.cited.type.game} +\alias{citing.cited.type.game} +\title{Random citation graphs} +\usage{ +citing.cited.type.game( + n, + edges = 1, + types = rep(0, n), + pref = matrix(1, nrow = length(types), ncol = length(types)), + directed = TRUE, + attr = TRUE +) +} +\arguments{ +\item{n}{Number of vertices.} + +\item{edges}{Number of edges per step.} + +\item{types}{Vector of length \sQuote{\code{n}}, the types of the vertices. +Types are numbered from zero.} + +\item{pref}{Vector (\code{sample_last_cit()} and \code{sample_cit_types()} or +matrix (\code{sample_cit_cit_types()}) giving the (unnormalized) citation +probabilities for the different vertex types.} + +\item{directed}{Logical scalar, whether to generate directed networks.} + +\item{attr}{Logical scalar, whether to add the vertex types to the generated +graph as a vertex attribute called \sQuote{\code{type}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{citing.cited.type.game()} was renamed to \code{sample_cit_cit_types()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/connect.neighborhood.Rd b/man/connect.neighborhood.Rd new file mode 100644 index 00000000000..c7a65611aeb --- /dev/null +++ b/man/connect.neighborhood.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{connect.neighborhood} +\alias{connect.neighborhood} +\title{Neighborhood of graph vertices} +\usage{ +connect.neighborhood(graph, order, mode = c("all", "out", "in", "total")) +} +\arguments{ +\item{graph}{The input graph.} + +\item{order}{Integer giving the order of the neighborhood.} + +\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 +vertex in at most \code{order} steps are counted. For \sQuote{"in"} all +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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{connect.neighborhood()} was renamed to \code{connect()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/degree.sequence.game.Rd b/man/degree.sequence.game.Rd new file mode 100644 index 00000000000..1ad6a9fc821 --- /dev/null +++ b/man/degree.sequence.game.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{degree.sequence.game} +\alias{degree.sequence.game} +\title{Generate random graphs with a given degree sequence} +\usage{ +degree.sequence.game( + out.deg, + in.deg = NULL, + method = c("simple", "vl", "simple.no.multiple", "simple.no.multiple.uniform") +) +} +\arguments{ +\item{out.deg}{Numeric vector, the sequence of degrees (for undirected +graphs) or out-degrees (for directed graphs). For undirected graphs its sum +should be even. For directed graphs its sum should be the same as the sum of +\code{in.deg}.} + +\item{in.deg}{For directed graph, the in-degree sequence. By default this is +\code{NULL} and an undirected graph is created.} + +\item{method}{Character, the method for generating the graph. Right now the +\dQuote{simple}, \dQuote{simple.no.multiple} and \dQuote{vl} methods are +implemented.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{degree.sequence.game()} was renamed to \code{sample_degseq()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/establishment.game.Rd b/man/establishment.game.Rd new file mode 100644 index 00000000000..fdf872fe2d9 --- /dev/null +++ b/man/establishment.game.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{establishment.game} +\alias{establishment.game} +\title{Graph generation based on different vertex types} +\usage{ +establishment.game( + nodes, + types, + k = 1, + type.dist = rep(1, types), + pref.matrix = matrix(1, types, types), + directed = FALSE +) +} +\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.} + +\item{type.dist}{The distribution of the vertex types. This is assumed to be +stationary in time.} + +\item{pref.matrix}{A matrix giving the preferences of the given vertex +types. These should be probabilities, i.e. numbers between zero and one.} + +\item{directed}{Logical constant, whether to generate directed graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{establishment.game()} was renamed to \code{sample_traits()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/forest.fire.game.Rd b/man/forest.fire.game.Rd new file mode 100644 index 00000000000..fac253a8b47 --- /dev/null +++ b/man/forest.fire.game.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{forest.fire.game} +\alias{forest.fire.game} +\title{Forest Fire Network Model} +\usage{ +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 +probability is calculated as \code{bw.factor*fw.prob}.} + +\item{ambs}{The number of ambassador vertices.} + +\item{directed}{Logical scalar, whether to create a directed graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{forest.fire.game()} was renamed to \code{sample_forestfire()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/grg.game.Rd b/man/grg.game.Rd new file mode 100644 index 00000000000..e5858787f3b --- /dev/null +++ b/man/grg.game.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{grg.game} +\alias{grg.game} +\title{Geometric random graphs} +\usage{ +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.} + +\item{torus}{Logical constant, whether to use a torus instead of a square.} + +\item{coords}{Logical scalar, whether to add the positions of the vertices +as vertex attributes called \sQuote{\code{x}} and \sQuote{\code{y}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{grg.game()} was renamed to \code{sample_grg()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/growing.random.game.Rd b/man/growing.random.game.Rd new file mode 100644 index 00000000000..4d575cb50fb --- /dev/null +++ b/man/growing.random.game.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{growing.random.game} +\alias{growing.random.game} +\title{Growing random graph generation} +\usage{ +growing.random.game(n, m = 1, directed = TRUE, citation = FALSE) +} +\arguments{ +\item{n}{Numeric constant, number of vertices in the graph.} + +\item{m}{Numeric constant, number of edges added in each time step.} + +\item{directed}{Logical, whether to create a directed graph.} + +\item{citation}{Logical. If \code{TRUE} a citation graph is created, i.e. in +each time step the added edges are originating from the new vertex.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{growing.random.game()} was renamed to \code{sample_growing()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/interconnected.islands.game.Rd b/man/interconnected.islands.game.Rd new file mode 100644 index 00000000000..93d945f8cf7 --- /dev/null +++ b/man/interconnected.islands.game.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{interconnected.islands.game} +\alias{interconnected.islands.game} +\title{A graph with subgraphs that are each a random graph.} +\usage{ +interconnected.islands.game(islands.n, islands.size, islands.pin, n.inter) +} +\arguments{ +\item{islands.n}{The number of islands in the graph.} + +\item{islands.size}{The size of islands in the graph.} + +\item{islands.pin}{The probability to create each possible edge into each +island.} + +\item{n.inter}{The number of edges to create between two islands.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{interconnected.islands.game()} was renamed to \code{sample_islands()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/k.regular.game.Rd b/man/k.regular.game.Rd new file mode 100644 index 00000000000..f0fd01b0b5a --- /dev/null +++ b/man/k.regular.game.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{k.regular.game} +\alias{k.regular.game} +\title{Create a random regular graph} +\usage{ +k.regular.game(no.of.nodes, k, directed = FALSE, multiple = FALSE) +} +\arguments{ +\item{no.of.nodes}{Integer scalar, the number of vertices in the generated +graph.} + +\item{k}{Integer scalar, the degree of each vertex in the graph, or the +out-degree and in-degree in a directed graph.} + +\item{directed}{Logical scalar, whether to create a directed graph.} + +\item{multiple}{Logical scalar, whether multiple edges are allowed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{k.regular.game()} was renamed to \code{sample_k_regular()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/lastcit.game.Rd b/man/lastcit.game.Rd new file mode 100644 index 00000000000..eb3964a0aab --- /dev/null +++ b/man/lastcit.game.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{lastcit.game} +\alias{lastcit.game} +\title{Random citation graphs} +\usage{ +lastcit.game( + n, + edges = 1, + agebins = n/7100, + pref = (1:(agebins + 1))^-3, + directed = TRUE +) +} +\arguments{ +\item{n}{Number of vertices.} + +\item{edges}{Number of edges per step.} + +\item{agebins}{Number of aging bins.} + +\item{pref}{Vector (\code{sample_last_cit()} and \code{sample_cit_types()} or +matrix (\code{sample_cit_cit_types()}) giving the (unnormalized) citation +probabilities for the different vertex types.} + +\item{directed}{Logical scalar, whether to generate directed networks.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{lastcit.game()} was renamed to \code{sample_last_cit()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/preference.game.Rd b/man/preference.game.Rd new file mode 100644 index 00000000000..c24b04fd7ee --- /dev/null +++ b/man/preference.game.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{preference.game} +\alias{preference.game} +\title{Trait-based random generation} +\usage{ +preference.game( + nodes, + types, + type.dist = rep(1, types), + fixed.sizes = FALSE, + pref.matrix = matrix(1, types, types), + directed = FALSE, + loops = FALSE +) +} +\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 +length \sQuote{types} containing non-negative numbers. The vector will be +normed to obtain probabilities.} + +\item{fixed.sizes}{Fix the number of vertices with a given vertex type +label. The \code{type.dist} argument gives the group sizes (i.e. number of +vertices with the different labels) in this case.} + +\item{pref.matrix}{A square matrix giving the preferences of the vertex +types. The matrix has \sQuote{types} rows and columns. When generating +an undirected graph, it must be symmetric.} + +\item{directed}{Logical constant, whether to create a directed graph.} + +\item{loops}{Logical constant, whether self-loops are allowed in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{preference.game()} was renamed to \code{sample_pref()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/sample_bipartite.Rd b/man/sample_bipartite.Rd index bc9f490a82d..91e0781b878 100644 --- a/man/sample_bipartite.Rd +++ b/man/sample_bipartite.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_bipartite} \alias{sample_bipartite} -\alias{bipartite.random.game} \alias{bipartite} \title{Bipartite random graphs} \usage{ diff --git a/man/sample_degseq.Rd b/man/sample_degseq.Rd index 1fb97e00443..09617df5d2b 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{degree.sequence.game} \alias{degseq} \title{Generate random graphs with a given degree sequence} \usage{ diff --git a/man/sample_fitness.Rd b/man/sample_fitness.Rd index 408b230ce79..b878dcb4739 100644 --- a/man/sample_fitness.Rd +++ b/man/sample_fitness.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_fitness} \alias{sample_fitness} -\alias{static.fitness.game} \title{Random graphs from vertex fitness scores} \usage{ sample_fitness( diff --git a/man/sample_fitness_pl.Rd b/man/sample_fitness_pl.Rd index 8d7957e5744..eae1e4110b4 100644 --- a/man/sample_fitness_pl.Rd +++ b/man/sample_fitness_pl.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_fitness_pl} \alias{sample_fitness_pl} -\alias{static.power.law.game} \title{Scale-free random graphs, from vertex fitness scores} \usage{ sample_fitness_pl( diff --git a/man/sample_forestfire.Rd b/man/sample_forestfire.Rd index db2a5534067..e88105558c2 100644 --- a/man/sample_forestfire.Rd +++ b/man/sample_forestfire.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_forestfire} \alias{sample_forestfire} -\alias{forest.fire.game} \title{Forest Fire Network Model} \usage{ sample_forestfire(nodes, fw.prob, bw.factor = 1, ambs = 1, directed = TRUE) diff --git a/man/sample_grg.Rd b/man/sample_grg.Rd index 9ffec05cf94..7776d8991ca 100644 --- a/man/sample_grg.Rd +++ b/man/sample_grg.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_grg} \alias{sample_grg} -\alias{grg.game} \alias{grg} \title{Geometric random graphs} \usage{ diff --git a/man/sample_growing.Rd b/man/sample_growing.Rd index 3119b02daeb..11147f02c65 100644 --- a/man/sample_growing.Rd +++ b/man/sample_growing.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_growing} \alias{sample_growing} -\alias{growing.random.game} \alias{growing} \title{Growing random graph generation} \usage{ diff --git a/man/sample_islands.Rd b/man/sample_islands.Rd index 04dcf2d1f1b..a8f3e05bd4d 100644 --- a/man/sample_islands.Rd +++ b/man/sample_islands.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_islands} \alias{sample_islands} -\alias{interconnected.islands.game} \title{A graph with subgraphs that are each a random graph.} \usage{ sample_islands(islands.n, islands.size, islands.pin, n.inter) diff --git a/man/sample_k_regular.Rd b/man/sample_k_regular.Rd index 6808ab72f48..ae53261bfad 100644 --- a/man/sample_k_regular.Rd +++ b/man/sample_k_regular.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_k_regular} \alias{sample_k_regular} -\alias{k.regular.game} \title{Create a random regular graph} \usage{ sample_k_regular(no.of.nodes, k, directed = FALSE, multiple = FALSE) diff --git a/man/sample_last_cit.Rd b/man/sample_last_cit.Rd index e2cda97269d..acc92bf547c 100644 --- a/man/sample_last_cit.Rd +++ b/man/sample_last_cit.Rd @@ -2,9 +2,6 @@ % Please edit documentation in R/games.R \name{sample_last_cit} \alias{sample_last_cit} -\alias{cited.type.game} -\alias{citing.cited.type.game} -\alias{lastcit.game} \alias{last_cit} \alias{sample_cit_types} \alias{cit_types} diff --git a/man/sample_pa.Rd b/man/sample_pa.Rd index c0b0834d8d0..f505f5d1b09 100644 --- a/man/sample_pa.Rd +++ b/man/sample_pa.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/games.R \name{sample_pa} \alias{sample_pa} -\alias{barabasi.game} -\alias{ba.game} \alias{pa} \title{Generate random graphs using preferential attachment} \usage{ diff --git a/man/sample_pa_age.Rd b/man/sample_pa_age.Rd index 71ea30266ce..0833b2f376f 100644 --- a/man/sample_pa_age.Rd +++ b/man/sample_pa_age.Rd @@ -2,9 +2,6 @@ % Please edit documentation in R/games.R \name{sample_pa_age} \alias{sample_pa_age} -\alias{aging.prefatt.game} -\alias{aging.barabasi.game} -\alias{aging.ba.game} \alias{pa_age} \title{Generate an evolving random graph with preferential attachment and aging} \usage{ diff --git a/man/sample_pref.Rd b/man/sample_pref.Rd index cda43d43054..c8b37f68ddf 100644 --- a/man/sample_pref.Rd +++ b/man/sample_pref.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/games.R \name{sample_pref} \alias{sample_pref} -\alias{preference.game} -\alias{asymmetric.preference.game} \alias{pref} \alias{sample_asym_pref} \alias{asym_pref} diff --git a/man/sample_sbm.Rd b/man/sample_sbm.Rd index a8eaa2ac568..c22bd156a21 100644 --- a/man/sample_sbm.Rd +++ b/man/sample_sbm.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_sbm} \alias{sample_sbm} -\alias{sbm.game} \alias{sbm} \title{Sample stochastic block model} \usage{ diff --git a/man/sample_smallworld.Rd b/man/sample_smallworld.Rd index c1752b7b435..d789ca2a90b 100644 --- a/man/sample_smallworld.Rd +++ b/man/sample_smallworld.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/games.R \name{sample_smallworld} \alias{sample_smallworld} -\alias{watts.strogatz.game} \alias{smallworld} \title{The Watts-Strogatz small-world model} \usage{ diff --git a/man/sample_traits_callaway.Rd b/man/sample_traits_callaway.Rd index a33699f0704..c49bfdeceae 100644 --- a/man/sample_traits_callaway.Rd +++ b/man/sample_traits_callaway.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/games.R \name{sample_traits_callaway} \alias{sample_traits_callaway} -\alias{callaway.traits.game} -\alias{establishment.game} \alias{traits_callaway} \alias{sample_traits} \alias{traits} diff --git a/man/sbm.game.Rd b/man/sbm.game.Rd new file mode 100644 index 00000000000..21f8a4d1b16 --- /dev/null +++ b/man/sbm.game.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{sbm.game} +\alias{sbm.game} +\title{Sample stochastic block model} +\usage{ +sbm.game(n, pref.matrix, block.sizes, directed = FALSE, loops = FALSE) +} +\arguments{ +\item{n}{Number of vertices in the graph.} + +\item{pref.matrix}{The matrix giving the Bernoulli rates. This is a +\eqn{K\times K}{KxK} matrix, where \eqn{K} is the number of groups. The +probability of creating an edge between vertices from groups \eqn{i} and +\eqn{j} is given by element \eqn{(i,j)}. For undirected graphs, this matrix +must be symmetric.} + +\item{block.sizes}{Numeric vector giving the number of vertices in each +group. The sum of the vector must match the number of vertices.} + +\item{directed}{Logical scalar, whether to generate a directed graph.} + +\item{loops}{Logical scalar, whether self-loops are allowed in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{sbm.game()} was renamed to \code{sample_sbm()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/static.fitness.game.Rd b/man/static.fitness.game.Rd new file mode 100644 index 00000000000..c74c06399aa --- /dev/null +++ b/man/static.fitness.game.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{static.fitness.game} +\alias{static.fitness.game} +\title{Random graphs from vertex fitness scores} +\usage{ +static.fitness.game( + no.of.edges, + fitness.out, + fitness.in = NULL, + loops = FALSE, + multiple = FALSE +) +} +\arguments{ +\item{no.of.edges}{The number of edges in the generated graph.} + +\item{fitness.out}{A numeric vector containing the fitness of each vertex. +For directed graphs, this specifies the out-fitness of each vertex.} + +\item{fitness.in}{If \code{NULL} (the default), the generated graph will be +undirected. If not \code{NULL}, then it should be a numeric vector and it +specifies the in-fitness of each vertex. + +If this argument is not \code{NULL}, then a directed graph is generated, +otherwise an undirected one.} + +\item{loops}{Logical scalar, whether to allow loop edges in the graph.} + +\item{multiple}{Logical scalar, whether to allow multiple edges in the +graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{static.fitness.game()} was renamed to \code{sample_fitness()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/static.power.law.game.Rd b/man/static.power.law.game.Rd new file mode 100644 index 00000000000..99d64735e07 --- /dev/null +++ b/man/static.power.law.game.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{static.power.law.game} +\alias{static.power.law.game} +\title{Scale-free random graphs, from vertex fitness scores} +\usage{ +static.power.law.game( + no.of.nodes, + no.of.edges, + exponent.out, + exponent.in = -1, + loops = FALSE, + multiple = FALSE, + finite.size.correction = TRUE +) +} +\arguments{ +\item{no.of.nodes}{The number of vertices in the generated graph.} + +\item{no.of.edges}{The number of edges in the generated graph.} + +\item{exponent.out}{Numeric scalar, the power law exponent of the degree +distribution. For directed graphs, this specifies the exponent of the +out-degree distribution. It must be greater than or equal to 2. If you pass +\code{Inf} here, you will get back an Erdős-Rényi random network.} + +\item{exponent.in}{Numeric scalar. If negative, the generated graph will be +undirected. If greater than or equal to 2, this argument specifies the +exponent of the in-degree distribution. If non-negative but less than 2, an +error will be generated.} + +\item{loops}{Logical scalar, whether to allow loop edges in the generated +graph.} + +\item{multiple}{Logical scalar, whether to allow multiple edges in the +generated graph.} + +\item{finite.size.correction}{Logical scalar, whether to use the proposed +finite size correction of Cho et al., see references below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{static.power.law.game()} was renamed to \code{sample_fitness_pl()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/watts.strogatz.game.Rd b/man/watts.strogatz.game.Rd new file mode 100644 index 00000000000..866efb74b2e --- /dev/null +++ b/man/watts.strogatz.game.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/games.R +\name{watts.strogatz.game} +\alias{watts.strogatz.game} +\title{The Watts-Strogatz small-world model} +\usage{ +watts.strogatz.game(dim, size, nei, p, loops = FALSE, multiple = FALSE) +} +\arguments{ +\item{dim}{Integer constant, the dimension of the starting lattice.} + +\item{size}{Integer constant, the size of the lattice along each dimension.} + +\item{nei}{Integer constant, the neighborhood within which the vertices of +the lattice will be connected.} + +\item{p}{Real constant between zero and one, the rewiring probability.} + +\item{loops}{Logical scalar, whether loops edges are allowed in the +generated graph.} + +\item{multiple}{Logical scalar, whether multiple edges are allowed int the +generated graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{watts.strogatz.game()} was renamed to \code{sample_smallworld()} to create a more +consistent API. +} +\keyword{internal} From 97883ea7ac3a6f875a40f20e024c5e3ab9d6c0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:02:15 +0100 Subject: [PATCH 25/48] refactor!: change R/glet.R --- R/glet.R | 34 ++++++++++++++++++++++++++---- man/graphlet_basis.Rd | 2 -- man/graphlets.candidate.basis.Rd | 23 ++++++++++++++++++++ man/graphlets.project.Rd | 36 ++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 6 deletions(-) create mode 100644 man/graphlets.candidate.basis.Rd create mode 100644 man/graphlets.project.Rd diff --git a/R/glet.R b/R/glet.R index 6195080a02f..9eb5dad4853 100644 --- a/R/glet.R +++ b/R/glet.R @@ -1,4 +1,34 @@ +#' Graphlet decomposition of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graphlets.project()` was renamed to `graphlet_proj()` to create a more +#' consistent API. +#' @inheritParams graphlet_proj +#' @keywords internal +#' @export +graphlets.project <- function(graph , weights = NULL , cliques , niter = 1000 , Mu = rep(1,length(cliques))) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graphlets.project()", "graphlet_proj()") + graphlet_proj(graph = graph, weights = weights, cliques = cliques, niter = niter, Mu = Mu) +} # nocov end + +#' Graphlet decomposition of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graphlets.candidate.basis()` was renamed to `graphlet_basis()` to create a more +#' consistent API. +#' @inheritParams graphlet_basis +#' @keywords internal +#' @export +graphlets.candidate.basis <- function(graph , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graphlets.candidate.basis()", "graphlet_basis()") + graphlet_basis(graph = graph, weights = weights) +} # nocov end + #' Graphlet decomposition of a graph #' #' Graphlet decomposition models a weighted undirected graph via the union of @@ -15,7 +45,6 @@ #' the algorithm, and they are useful if the user wishes to perform them #' individually: `graphlet_basis()` and `graphlet_proj()`. #' -#' @aliases graphlets.project graphlets.candidate.basis #' @param graph The input graph, edge directions are ignored. Only simple graph #' (i.e. graphs without self-loops and multiple edges) are supported. #' @param weights Edge weights. If the graph has a `weight` edge attribute @@ -178,6 +207,3 @@ function() { #' @export graphlets <- graphlets_impl #' @export graphlets.candidate.basis -deprecated("graphlets.candidate.basis", graphlet_basis) -#' @export graphlets.project -deprecated("graphlets.project", graphlet_proj) diff --git a/man/graphlet_basis.Rd b/man/graphlet_basis.Rd index 56c9785329c..d0cd5c360be 100644 --- a/man/graphlet_basis.Rd +++ b/man/graphlet_basis.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/glet.R \name{graphlet_basis} \alias{graphlet_basis} -\alias{graphlets.project} -\alias{graphlets.candidate.basis} \alias{graphlet_proj} \alias{graphlets} \title{Graphlet decomposition of a graph} diff --git a/man/graphlets.candidate.basis.Rd b/man/graphlets.candidate.basis.Rd new file mode 100644 index 00000000000..7a6a12a12b0 --- /dev/null +++ b/man/graphlets.candidate.basis.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/glet.R +\name{graphlets.candidate.basis} +\alias{graphlets.candidate.basis} +\title{Graphlet decomposition of a graph} +\usage{ +graphlets.candidate.basis(graph, weights = NULL) +} +\arguments{ +\item{graph}{The input graph, edge directions are ignored. Only simple graph +(i.e. graphs without self-loops and multiple edges) are supported.} + +\item{weights}{Edge weights. If the graph has a \code{weight} edge attribute +and this argument is \code{NULL} (the default), then the \code{weight} edge +attribute is used.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graphlets.candidate.basis()} was renamed to \code{graphlet_basis()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graphlets.project.Rd b/man/graphlets.project.Rd new file mode 100644 index 00000000000..e16e9554f45 --- /dev/null +++ b/man/graphlets.project.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/glet.R +\name{graphlets.project} +\alias{graphlets.project} +\title{Graphlet decomposition of a graph} +\usage{ +graphlets.project( + graph, + weights = NULL, + cliques, + niter = 1000, + Mu = rep(1, length(cliques)) +) +} +\arguments{ +\item{graph}{The input graph, edge directions are ignored. Only simple graph +(i.e. graphs without self-loops and multiple edges) are supported.} + +\item{weights}{Edge weights. If the graph has a \code{weight} edge attribute +and this argument is \code{NULL} (the default), then the \code{weight} edge +attribute is used.} + +\item{cliques}{A list of vertex ids, the graphlet basis to use for the +projection.} + +\item{niter}{Integer scalar, the number of iterations to perform.} + +\item{Mu}{Starting weights for the projection.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graphlets.project()} was renamed to \code{graphlet_proj()} to create a more +consistent API. +} +\keyword{internal} From 6f810cd0ceda5b09778051daeabeb2c81fa17470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:02:48 +0100 Subject: [PATCH 26/48] refactor!: change R/hrg.R --- R/hrg.R | 108 ++++++++++++++++++++++++++----- man/consensus_tree.Rd | 1 - man/fit_hrg.Rd | 1 - man/hrg.Rd | 1 - man/hrg.consensus.Rd | 29 +++++++++ man/hrg.create.Rd | 21 ++++++ man/hrg.dendrogram.Rd | 18 ++++++ man/hrg.fit.Rd | 29 +++++++++ man/hrg.game.Rd | 18 ++++++ man/hrg.predict.Rd | 39 +++++++++++ man/plot_dendrogram.igraphHRG.Rd | 1 - man/predict_edges.Rd | 1 - man/sample_hrg.Rd | 1 - 13 files changed, 245 insertions(+), 23 deletions(-) create mode 100644 man/hrg.consensus.Rd create mode 100644 man/hrg.create.Rd create mode 100644 man/hrg.dendrogram.Rd create mode 100644 man/hrg.fit.Rd create mode 100644 man/hrg.game.Rd create mode 100644 man/hrg.predict.Rd diff --git a/R/hrg.R b/R/hrg.R index 3a04f9ea2be..6aa5739be7d 100644 --- a/R/hrg.R +++ b/R/hrg.R @@ -1,3 +1,94 @@ + +#' Predict edges based on a hierarchical random graph model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.predict()` was renamed to `predict_edges()` to create a more +#' consistent API. +#' @inheritParams predict_edges +#' @keywords internal +#' @export +hrg.predict <- function(graph , hrg = NULL , start = FALSE , num.samples = 10000 , num.bins = 25) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.predict()", "predict_edges()") + predict_edges(graph = graph, hrg = hrg, start = start, num.samples = num.samples, num.bins = num.bins) +} # nocov end + +#' Fit a hierarchical random graph model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.fit()` was renamed to `fit_hrg()` to create a more +#' consistent API. +#' @inheritParams fit_hrg +#' @keywords internal +#' @export +hrg.fit <- function(graph , hrg = NULL , start = FALSE , steps = 0) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.fit()", "fit_hrg()") + fit_hrg(graph = graph, hrg = hrg, start = start, steps = steps) +} # nocov end + +#' Sample from a hierarchical random graph model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.game()` was renamed to `sample_hrg()` to create a more +#' consistent API. +#' @inheritParams sample_hrg +#' @keywords internal +#' @export +hrg.game <- function(hrg) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.game()", "sample_hrg()") + sample_hrg(hrg = hrg) +} # nocov end + +#' Create an igraph graph from a hierarchical random graph model +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.dendrogram()` was renamed to `hrg_tree()` to create a more +#' consistent API. +#' @inheritParams hrg_tree +#' @keywords internal +#' @export +hrg.dendrogram <- function(hrg) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.dendrogram()", "hrg_tree()") + hrg_tree(hrg = hrg) +} # nocov end + +#' Create a hierarchical random graph from an igraph graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.create()` was renamed to `hrg()` to create a more +#' consistent API. +#' @inheritParams hrg +#' @keywords internal +#' @export +hrg.create <- function(graph , prob) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.create()", "hrg()") + hrg(graph = graph, prob = prob) +} # nocov end + +#' Create a consensus tree from several hierarchical random graph models +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `hrg.consensus()` was renamed to `consensus_tree()` to create a more +#' consistent API. +#' @inheritParams consensus_tree +#' @keywords internal +#' @export +hrg.consensus <- function(graph , hrg = NULL , start = FALSE , num.samples = 10000) { # nocov start + lifecycle::deprecate_soft("1.6.0", "hrg.consensus()", "consensus_tree()") + consensus_tree(graph = graph, hrg = hrg, start = start, num.samples = num.samples) +} # nocov end + # IGraph R package # Copyright (C) 2011-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -55,7 +146,6 @@ NULL #' `start` argument is `TRUE`. It can be converted to the `hclust` class using #' `as.hclust()` provided in this package. #' -#' @aliases hrg.fit #' @param graph The graph to fit the model to. Edge directions are ignored in #' directed graphs. #' @param hrg A hierarchical random graph model, in the form of an @@ -149,7 +239,6 @@ fit_hrg <- function(graph, hrg = NULL, start = FALSE, steps = 0) { #' sampling from the given HRG. Otherwise it optimizes the HRG log-likelihood #' first, and then samples starting from the optimum. #' -#' @aliases hrg.consensus #' @param graph The graph the models were fitted to. #' @param hrg A hierarchical random graph model, in the form of an #' `igraphHRG` object. `consensus_tree()` allows this to be @@ -182,7 +271,6 @@ consensus_tree <- hrg_consensus_impl #' vertices. The `prob` argument contains the HRG probability labels #' for each vertex; these are ignored for leaf vertices. #' -#' @aliases hrg.create #' @param graph The igraph graph to create the HRG from. #' @param prob A vector of probabilities, one for each vertex, in the order of #' vertex ids. @@ -211,7 +299,6 @@ hrg_tree <- hrg_dendrogram_impl #' `sample_hrg()` samples a graph from a given hierarchical random graph #' model. #' -#' @aliases hrg.game #' @param hrg A hierarchical random graph model. #' @return An igraph graph. #' @@ -228,7 +315,6 @@ sample_hrg <- hrg_game_impl #' argument is set to `TRUE`. Otherwise a HRG is fitted to the graph #' first. #' -#' @aliases hrg.predict #' @param graph The graph to fit the model to. Edge directions are ignored in #' directed graphs. #' @param hrg A hierarchical random graph model, in the form of an @@ -574,7 +660,6 @@ rlang::on_load(s3_register("ape::as.phylo", "igraphHRG")) #' plot_dendrogram(x, \dots) #' } The extra arguments are simply passed to [as.dendrogram()]. #' -#' @aliases hrg.dendrogram #' @param x An `igraphHRG`, a hierarchical random graph, as returned by #' the [fit_hrg()] function. #' @param mode Which dendrogram plotting function to use. See details below. @@ -936,14 +1021,3 @@ B-7 p=1 B-5 2 " #' @export hrg.consensus -deprecated("hrg.consensus", consensus_tree) -#' @export hrg.create -deprecated("hrg.create", hrg) -#' @export hrg.dendrogram -deprecated("hrg.dendrogram", hrg_tree) -#' @export hrg.game -deprecated("hrg.game", sample_hrg) -#' @export hrg.fit -deprecated("hrg.fit", fit_hrg) -#' @export hrg.predict -deprecated("hrg.predict", predict_edges) diff --git a/man/consensus_tree.Rd b/man/consensus_tree.Rd index 222751059ae..d35ca4c497d 100644 --- a/man/consensus_tree.Rd +++ b/man/consensus_tree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{consensus_tree} \alias{consensus_tree} -\alias{hrg.consensus} \title{Create a consensus tree from several hierarchical random graph models} \usage{ consensus_tree(graph, hrg = NULL, start = FALSE, num.samples = 10000) diff --git a/man/fit_hrg.Rd b/man/fit_hrg.Rd index 70fdab58cf2..1c9f67adba3 100644 --- a/man/fit_hrg.Rd +++ b/man/fit_hrg.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{fit_hrg} \alias{fit_hrg} -\alias{hrg.fit} \title{Fit a hierarchical random graph model} \usage{ fit_hrg(graph, hrg = NULL, start = FALSE, steps = 0) diff --git a/man/hrg.Rd b/man/hrg.Rd index 62cf65fa821..98cdab96ffb 100644 --- a/man/hrg.Rd +++ b/man/hrg.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{hrg} \alias{hrg} -\alias{hrg.create} \title{Create a hierarchical random graph from an igraph graph} \usage{ hrg(graph, prob) diff --git a/man/hrg.consensus.Rd b/man/hrg.consensus.Rd new file mode 100644 index 00000000000..a2cf893ed45 --- /dev/null +++ b/man/hrg.consensus.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.consensus} +\alias{hrg.consensus} +\title{Create a consensus tree from several hierarchical random graph models} +\usage{ +hrg.consensus(graph, hrg = NULL, start = FALSE, num.samples = 10000) +} +\arguments{ +\item{graph}{The graph the models were fitted to.} + +\item{hrg}{A hierarchical random graph model, in the form of an +\code{igraphHRG} object. \code{consensus_tree()} allows this to be +\code{NULL} as well, then a HRG is fitted to the graph first, from a +random starting point.} + +\item{start}{Logical, whether to start the fitting/sampling from the +supplied \code{igraphHRG} object, or from a random starting point.} + +\item{num.samples}{Number of samples to use for consensus generation or +missing edge prediction.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.consensus()} was renamed to \code{consensus_tree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hrg.create.Rd b/man/hrg.create.Rd new file mode 100644 index 00000000000..86bcf734829 --- /dev/null +++ b/man/hrg.create.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.create} +\alias{hrg.create} +\title{Create a hierarchical random graph from an igraph graph} +\usage{ +hrg.create(graph, prob) +} +\arguments{ +\item{graph}{The igraph graph to create the HRG from.} + +\item{prob}{A vector of probabilities, one for each vertex, in the order of +vertex ids.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.create()} was renamed to \code{hrg()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hrg.dendrogram.Rd b/man/hrg.dendrogram.Rd new file mode 100644 index 00000000000..f163c00e3f1 --- /dev/null +++ b/man/hrg.dendrogram.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.dendrogram} +\alias{hrg.dendrogram} +\title{Create an igraph graph from a hierarchical random graph model} +\usage{ +hrg.dendrogram(hrg) +} +\arguments{ +\item{hrg}{A hierarchical random graph model.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.dendrogram()} was renamed to \code{hrg_tree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hrg.fit.Rd b/man/hrg.fit.Rd new file mode 100644 index 00000000000..0684aa26512 --- /dev/null +++ b/man/hrg.fit.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.fit} +\alias{hrg.fit} +\title{Fit a hierarchical random graph model} +\usage{ +hrg.fit(graph, hrg = NULL, start = FALSE, steps = 0) +} +\arguments{ +\item{graph}{The graph to fit the model to. Edge directions are ignored in +directed graphs.} + +\item{hrg}{A hierarchical random graph model, in the form of an +\code{igraphHRG} object. \code{fit_hrg()} allows this to be \code{NULL}, in +which case a random starting point is used for the fitting.} + +\item{start}{Logical, whether to start the fitting/sampling from the +supplied \code{igraphHRG} object, or from a random starting point.} + +\item{steps}{The number of MCMC steps to make. If this is zero, then the +MCMC procedure is performed until convergence.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.fit()} was renamed to \code{fit_hrg()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hrg.game.Rd b/man/hrg.game.Rd new file mode 100644 index 00000000000..b58e25dad60 --- /dev/null +++ b/man/hrg.game.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.game} +\alias{hrg.game} +\title{Sample from a hierarchical random graph model} +\usage{ +hrg.game(hrg) +} +\arguments{ +\item{hrg}{A hierarchical random graph model.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.game()} was renamed to \code{sample_hrg()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/hrg.predict.Rd b/man/hrg.predict.Rd new file mode 100644 index 00000000000..5a833edbfb2 --- /dev/null +++ b/man/hrg.predict.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/hrg.R +\name{hrg.predict} +\alias{hrg.predict} +\title{Predict edges based on a hierarchical random graph model} +\usage{ +hrg.predict( + graph, + hrg = NULL, + start = FALSE, + num.samples = 10000, + num.bins = 25 +) +} +\arguments{ +\item{graph}{The graph to fit the model to. Edge directions are ignored in +directed graphs.} + +\item{hrg}{A hierarchical random graph model, in the form of an +\code{igraphHRG} object. \code{predict_edges()} allow this to be +\code{NULL} as well, then a HRG is fitted to the graph first, from a +random starting point.} + +\item{start}{Logical, whether to start the fitting/sampling from the +supplied \code{igraphHRG} object, or from a random starting point.} + +\item{num.samples}{Number of samples to use for consensus generation or +missing edge prediction.} + +\item{num.bins}{Number of bins for the edge probabilities. Give a higher +number for a more accurate prediction.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{hrg.predict()} was renamed to \code{predict_edges()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/plot_dendrogram.igraphHRG.Rd b/man/plot_dendrogram.igraphHRG.Rd index 65f7cc2d7ef..fd00e13ada4 100644 --- a/man/plot_dendrogram.igraphHRG.Rd +++ b/man/plot_dendrogram.igraphHRG.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{plot_dendrogram.igraphHRG} \alias{plot_dendrogram.igraphHRG} -\alias{hrg.dendrogram} \title{HRG dendrogram plot} \usage{ \method{plot_dendrogram}{igraphHRG}(x, mode = igraph_opt("dend.plot.type"), ...) diff --git a/man/predict_edges.Rd b/man/predict_edges.Rd index 3d9afb2525d..219eee6edad 100644 --- a/man/predict_edges.Rd +++ b/man/predict_edges.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{predict_edges} \alias{predict_edges} -\alias{hrg.predict} \title{Predict edges based on a hierarchical random graph model} \usage{ predict_edges( diff --git a/man/sample_hrg.Rd b/man/sample_hrg.Rd index d7a42233ea1..cfd9ac0b1ce 100644 --- a/man/sample_hrg.Rd +++ b/man/sample_hrg.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/hrg.R \name{sample_hrg} \alias{sample_hrg} -\alias{hrg.game} \title{Sample from a hierarchical random graph model} \usage{ sample_hrg(hrg) From 2542e0c14e84c5b65d1b916ab587584b58fdd4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:03:21 +0100 Subject: [PATCH 27/48] refactor!: change R/incidence.R --- R/incidence.R | 17 ++++++++- man/graph.incidence.Rd | 56 ++++++++++++++++++++++++++++ man/graph_from_biadjacency_matrix.Rd | 1 - 3 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 man/graph.incidence.Rd diff --git a/R/incidence.R b/R/incidence.R index a55d3fa9df3..39d2b1e9a26 100644 --- a/R/incidence.R +++ b/R/incidence.R @@ -1,4 +1,19 @@ +#' Create graphs from a bipartite adjacency matrix +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.incidence()` was renamed to `graph_from_biadjacency_matrix()` to create a more +#' consistent API. +#' @inheritParams graph_from_biadjacency_matrix +#' @keywords internal +#' @export +graph.incidence <- function(incidence , directed = FALSE , mode = c("all","out","in","total") , multiple = FALSE , weighted = NULL , add.names = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.incidence()", "graph_from_biadjacency_matrix()") + graph_from_biadjacency_matrix(incidence = incidence, directed = directed, mode = mode, multiple = multiple, weighted = weighted, add.names = add.names) +} # nocov end + ## ---------------------------------------------------------------- ## ## IGraph R package @@ -153,7 +168,6 @@ graph.incidence.dense <- function(incidence, directed, mode, multiple, #' the closest non-negative integer to get the number of edges to create #' between a pair of vertices. #' -#' @aliases graph.incidence #' @param incidence The input bipartite adjacency matrix. It can also be a sparse matrix #' from the `Matrix` package. #' @param directed Logical scalar, whether to create a directed graph. @@ -285,4 +299,3 @@ graph_from_incidence_matrix <- function(...) { # nocov start graph_from_biadjacency_matrix(...) } # nocov end #' @export graph.incidence -deprecated("graph.incidence", graph_from_biadjacency_matrix) diff --git a/man/graph.incidence.Rd b/man/graph.incidence.Rd new file mode 100644 index 00000000000..1f0922a4436 --- /dev/null +++ b/man/graph.incidence.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/incidence.R +\name{graph.incidence} +\alias{graph.incidence} +\title{Create graphs from a bipartite adjacency matrix} +\usage{ +graph.incidence( + incidence, + directed = FALSE, + mode = c("all", "out", "in", "total"), + multiple = FALSE, + weighted = NULL, + add.names = NULL +) +} +\arguments{ +\item{incidence}{The input bipartite adjacency matrix. It can also be a sparse matrix +from the \code{Matrix} package.} + +\item{directed}{Logical scalar, whether to create a directed graph.} + +\item{mode}{A character constant, defines the direction of the edges in +directed graphs, ignored for undirected graphs. If \sQuote{\code{out}}, then +edges go from vertices of the first kind (corresponding to rows in the +bipartite adjacency matrix) to vertices of the second kind (columns in the incidence +matrix). If \sQuote{\verb{in}}, then the opposite direction is used. If +\sQuote{\code{all}} or \sQuote{\code{total}}, then mutual edges are created.} + +\item{multiple}{Logical scalar, specifies how to interpret the matrix +elements. See details below.} + +\item{weighted}{This argument specifies whether to create a weighted graph +from the bipartite adjacency matrix. If it is \code{NULL} then an unweighted graph is +created and the \code{multiple} argument is used to determine the edges of +the graph. If it is a character constant then for every non-zero matrix +entry an edge is created and the value of the entry is added as an edge +attribute named by the \code{weighted} argument. If it is \code{TRUE} then a +weighted graph is created and the name of the edge attribute will be +\sQuote{\code{weight}}.} + +\item{add.names}{A character constant, \code{NA} or \code{NULL}. +\code{graph_from_biadjacency_matrix()} can add the row and column names of the incidence +matrix as vertex attributes. If this argument is \code{NULL} (the default) +and the bipartite adjacency matrix has both row and column names, then these are added +as the \sQuote{\code{name}} vertex attribute. If you want a different vertex +attribute for this, then give the name of the attributes as a character +string. If this argument is \code{NA}, then no vertex attributes (other than +type) will be added.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.incidence()} was renamed to \code{graph_from_biadjacency_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_biadjacency_matrix.Rd b/man/graph_from_biadjacency_matrix.Rd index 3f4874ead70..19b85d2739c 100644 --- a/man/graph_from_biadjacency_matrix.Rd +++ b/man/graph_from_biadjacency_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/incidence.R \name{graph_from_biadjacency_matrix} \alias{graph_from_biadjacency_matrix} -\alias{graph.incidence} \title{Create graphs from a bipartite adjacency matrix} \usage{ graph_from_biadjacency_matrix( From e874677c646c10607cd380d102a235c2f4756092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:03:55 +0100 Subject: [PATCH 28/48] refactor!: change R/interface.R --- R/interface.R | 89 +++++++++++++++++++++++++++++++++++------- man/add.edges.Rd | 29 ++++++++++++++ man/add.vertices.Rd | 28 +++++++++++++ man/add_edges.Rd | 1 - man/add_vertices.Rd | 1 - man/delete.edges.Rd | 23 +++++++++++ man/delete.vertices.Rd | 20 ++++++++++ man/delete_edges.Rd | 1 - man/delete_vertices.Rd | 1 - man/is.directed.Rd | 18 +++++++++ man/is_directed.Rd | 1 - 11 files changed, 193 insertions(+), 19 deletions(-) create mode 100644 man/add.edges.Rd create mode 100644 man/add.vertices.Rd create mode 100644 man/delete.edges.Rd create mode 100644 man/delete.vertices.Rd create mode 100644 man/is.directed.Rd diff --git a/R/interface.R b/R/interface.R index a8202bf0543..d9a821146eb 100644 --- a/R/interface.R +++ b/R/interface.R @@ -1,3 +1,78 @@ + +#' Check whether a graph is directed +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.directed()` was renamed to `is_directed()` to create a more +#' consistent API. +#' @inheritParams is_directed +#' @keywords internal +#' @export +is.directed <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.directed()", "is_directed()") + is_directed(graph = graph) +} # nocov end + +#' Delete vertices from a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `delete.vertices()` was renamed to `delete_vertices()` to create a more +#' consistent API. +#' @inheritParams delete_vertices +#' @keywords internal +#' @export +delete.vertices <- function(graph , v) { # nocov start + lifecycle::deprecate_soft("1.6.0", "delete.vertices()", "delete_vertices()") + delete_vertices(graph = graph, v = v) +} # nocov end + +#' Delete edges from a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `delete.edges()` was renamed to `delete_edges()` to create a more +#' consistent API. +#' @inheritParams delete_edges +#' @keywords internal +#' @export +delete.edges <- function(graph , edges) { # nocov start + lifecycle::deprecate_soft("1.6.0", "delete.edges()", "delete_edges()") + delete_edges(graph = graph, edges = edges) +} # nocov end + +#' Add vertices to a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `add.vertices()` was renamed to `add_vertices()` to create a more +#' consistent API. +#' @inheritParams add_vertices +#' @keywords internal +#' @export +add.vertices <- function(graph , nv , ... , attr = list()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "add.vertices()", "add_vertices()") + add_vertices(graph = graph, nv = nv, attr = attr, ...) +} # nocov end + +#' Add edges to a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `add.edges()` was renamed to `add_edges()` to create a more +#' consistent API. +#' @inheritParams add_edges +#' @keywords internal +#' @export +add.edges <- function(graph , edges , ... , attr = list()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "add.edges()", "add_edges()") + add_edges(graph = graph, edges = edges, attr = attr, ...) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -46,7 +121,6 @@ #' #' @export #' -#' @aliases add.edges #' @family functions for manipulating graph structure #' #' @examples @@ -108,7 +182,6 @@ add_edges <- function(graph, edges, ..., attr = list()) { #' below. #' @return The graph, with the vertices (and attributes) added. #' -#' @aliases add.vertices #' @family functions for manipulating graph structure #' #' @export @@ -165,7 +238,6 @@ add_vertices <- function(graph, nv, ..., attr = list()) { #' `|` #' @return The graph, with the edges removed. #' -#' @aliases delete.edges #' @family functions for manipulating graph structure #' #' @export @@ -194,7 +266,6 @@ delete_edges <- function(graph, edges) { #' @param v The vertices to remove, a vertex sequence. #' @return The graph, with the vertices removed. #' -#' @aliases delete.vertices #' @family functions for manipulating graph structure #' #' @export @@ -338,7 +409,6 @@ incident <- function(graph, v, mode = c("all", "out", "in", "total")) { #' @param graph The input graph #' @return Logical scalar, whether the graph is directed. #' -#' @aliases is.directed #' @family structural queries #' #' @export @@ -574,12 +644,3 @@ incident_edges <- function(graph, v, res } #' @export add.edges -deprecated("add.edges", add_edges) -#' @export add.vertices -deprecated("add.vertices", add_vertices) -#' @export delete.edges -deprecated("delete.edges", delete_edges) -#' @export delete.vertices -deprecated("delete.vertices", delete_vertices) -#' @export is.directed -deprecated("is.directed", is_directed) diff --git a/man/add.edges.Rd b/man/add.edges.Rd new file mode 100644 index 00000000000..2a057e5eb56 --- /dev/null +++ b/man/add.edges.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/interface.R +\name{add.edges} +\alias{add.edges} +\title{Add edges to a graph} +\usage{ +add.edges(graph, edges, ..., attr = list()) +} +\arguments{ +\item{graph}{The input graph} + +\item{edges}{The edges to add, a vertex sequence with even number +of vertices.} + +\item{...}{Additional arguments, they must be named, +and they will be added as edge attributes, for the newly added +edges. See also details below.} + +\item{attr}{A named list, its elements will be added +as edge attributes, for the newly added edges. See also details +below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{add.edges()} was renamed to \code{add_edges()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/add.vertices.Rd b/man/add.vertices.Rd new file mode 100644 index 00000000000..2b22dc9a34a --- /dev/null +++ b/man/add.vertices.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/interface.R +\name{add.vertices} +\alias{add.vertices} +\title{Add vertices to a graph} +\usage{ +add.vertices(graph, nv, ..., attr = list()) +} +\arguments{ +\item{graph}{The input graph.} + +\item{nv}{The number of vertices to add.} + +\item{...}{Additional arguments, they must be named, +and they will be added as vertex attributes, for the newly added +vertices. See also details below.} + +\item{attr}{A named list, its elements will be added +as vertex attributes, for the newly added vertices. See also details +below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{add.vertices()} was renamed to \code{add_vertices()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/add_edges.Rd b/man/add_edges.Rd index 7e05d7483a2..79f8cebfb44 100644 --- a/man/add_edges.Rd +++ b/man/add_edges.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/interface.R \name{add_edges} \alias{add_edges} -\alias{add.edges} \title{Add edges to a graph} \usage{ add_edges(graph, edges, ..., attr = list()) diff --git a/man/add_vertices.Rd b/man/add_vertices.Rd index d0911fac5d9..30f3faeed49 100644 --- a/man/add_vertices.Rd +++ b/man/add_vertices.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/interface.R \name{add_vertices} \alias{add_vertices} -\alias{add.vertices} \title{Add vertices to a graph} \usage{ add_vertices(graph, nv, ..., attr = list()) diff --git a/man/delete.edges.Rd b/man/delete.edges.Rd new file mode 100644 index 00000000000..8782d65668f --- /dev/null +++ b/man/delete.edges.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/interface.R +\name{delete.edges} +\alias{delete.edges} +\title{Delete edges from a graph} +\usage{ +delete.edges(graph, edges) +} +\arguments{ +\item{graph}{The input graph.} + +\item{edges}{The edges to remove, specified as an edge sequence. Typically +this is either a numeric vector containing edge IDs, or a character vector +containing the IDs or names of the source and target vertices, separated by +\code{|}} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{delete.edges()} was renamed to \code{delete_edges()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/delete.vertices.Rd b/man/delete.vertices.Rd new file mode 100644 index 00000000000..4d605ba4cb2 --- /dev/null +++ b/man/delete.vertices.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/interface.R +\name{delete.vertices} +\alias{delete.vertices} +\title{Delete vertices from a graph} +\usage{ +delete.vertices(graph, v) +} +\arguments{ +\item{graph}{The input graph.} + +\item{v}{The vertices to remove, a vertex sequence.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{delete.vertices()} was renamed to \code{delete_vertices()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/delete_edges.Rd b/man/delete_edges.Rd index 448acc4573e..d8a81c4e8b2 100644 --- a/man/delete_edges.Rd +++ b/man/delete_edges.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/interface.R \name{delete_edges} \alias{delete_edges} -\alias{delete.edges} \title{Delete edges from a graph} \usage{ delete_edges(graph, edges) diff --git a/man/delete_vertices.Rd b/man/delete_vertices.Rd index ff96924401f..c0b800fed3f 100644 --- a/man/delete_vertices.Rd +++ b/man/delete_vertices.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/interface.R \name{delete_vertices} \alias{delete_vertices} -\alias{delete.vertices} \title{Delete vertices from a graph} \usage{ delete_vertices(graph, v) diff --git a/man/is.directed.Rd b/man/is.directed.Rd new file mode 100644 index 00000000000..6504ec7b979 --- /dev/null +++ b/man/is.directed.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/interface.R +\name{is.directed} +\alias{is.directed} +\title{Check whether a graph is directed} +\usage{ +is.directed(graph) +} +\arguments{ +\item{graph}{The input graph} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.directed()} was renamed to \code{is_directed()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_directed.Rd b/man/is_directed.Rd index 6ca6d94ddea..86c612636c5 100644 --- a/man/is_directed.Rd +++ b/man/is_directed.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/interface.R \name{is_directed} \alias{is_directed} -\alias{is.directed} \title{Check whether a graph is directed} \usage{ is_directed(graph) From 63d3518413af09fe4ac7cf75018f7d112c6c3b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:04:34 +0100 Subject: [PATCH 29/48] refactor!: change R/layout_drl.R --- R/layout_drl.R | 20 +++++++++++++++--- man/layout.drl.Rd | 47 ++++++++++++++++++++++++++++++++++++++++++ man/layout_with_drl.Rd | 1 - 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 man/layout.drl.Rd diff --git a/R/layout_drl.R b/R/layout_drl.R index 7b3355236e4..0fdc09ec6ae 100644 --- a/R/layout_drl.R +++ b/R/layout_drl.R @@ -1,4 +1,19 @@ +#' The DrL graph layout generator +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.drl()` was renamed to `layout_with_drl()` to create a more +#' consistent API. +#' @inheritParams layout_with_drl +#' @keywords internal +#' @export +layout.drl <- function(graph , use.seed = FALSE , seed = matrix(runif(vcount(graph)*2),ncol=2) , options = drl_defaults$default , weights = NULL , dim = 2) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.drl()", "layout_with_drl()") + layout_with_drl(graph = graph, use.seed = use.seed, seed = seed, options = options, weights = weights, dim = dim) +} # nocov end + #' The DrL graph layout generator #' #' DrL is a force-directed graph layout toolbox focused on real-world @@ -42,8 +57,8 @@ #' `drl_defaults$coarsest`, `drl_defaults$refine` and #' `drl_defaults$final`. } #' -#' @aliases layout.drl drl_defaults igraph.drl.coarsen -#' igraph.drl.coarsest igraph.drl.default igraph.drl.final +#' @aliases drl_defaults igraph.drl.coarsen +#' @aliases igraph.drl.coarsest igraph.drl.default igraph.drl.final #' igraph.drl.refine #' @param graph The input graph, in can be directed or undirected. #' @param use.seed Logical scalar, whether to use the coordinates given in the @@ -289,4 +304,3 @@ drl_defaults <- list( refine = igraph.drl.refine ) #' @export layout.drl -deprecated("layout.drl", layout_with_drl) diff --git a/man/layout.drl.Rd b/man/layout.drl.Rd new file mode 100644 index 00000000000..6ebc75bcff1 --- /dev/null +++ b/man/layout.drl.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout_drl.R +\name{layout.drl} +\alias{layout.drl} +\title{The DrL graph layout generator} +\usage{ +layout.drl( + graph, + use.seed = FALSE, + seed = matrix(runif(vcount(graph) * 2), ncol = 2), + options = drl_defaults$default, + weights = NULL, + dim = 2 +) +} +\arguments{ +\item{graph}{The input graph, in can be directed or undirected.} + +\item{use.seed}{Logical scalar, whether to use the coordinates given in the +\code{seed} argument as a starting point.} + +\item{seed}{A matrix with two columns, the starting coordinates for the +vertices is \code{use.seed} is \code{TRUE}. It is ignored otherwise.} + +\item{options}{Options for the layout generator, a named list. See details +below.} + +\item{weights}{The weights of the edges. It must be a positive numeric vector, +\code{NULL} or \code{NA}. If it is \code{NULL} and the input graph has a +\sQuote{weight} edge attribute, then that attribute will be used. If +\code{NULL} and no such attribute is present, then the edges will have equal +weights. Set this to \code{NA} if the graph was a \sQuote{weight} edge +attribute, but you don't want to use it for the layout. Larger edge weights +correspond to stronger connections.} + +\item{dim}{Either \sQuote{2} or \sQuote{3}, it specifies whether we want a +two dimensional or a three dimensional layout. Note that because of the +nature of the DrL algorithm, the three dimensional layout takes +significantly longer to compute.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.drl()} was renamed to \code{layout_with_drl()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout_with_drl.Rd b/man/layout_with_drl.Rd index bda99b682bc..993d7066c2b 100644 --- a/man/layout_with_drl.Rd +++ b/man/layout_with_drl.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout_drl.R \name{layout_with_drl} \alias{layout_with_drl} -\alias{layout.drl} \alias{drl_defaults} \alias{igraph.drl.coarsen} \alias{igraph.drl.coarsest} From 946969a2cd1b5965bf399f2747e1f077424fd3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:05:19 +0100 Subject: [PATCH 30/48] refactor!: change R/layout.R --- R/layout.R | 216 +++++++++++++++++++++++++++++------ man/layout.auto.Rd | 24 ++++ man/layout.bipartite.Rd | 33 ++++++ man/layout.davidson.harel.Rd | 55 +++++++++ man/layout.gem.Rd | 44 +++++++ man/layout.graphopt.Rd | 52 +++++++++ man/layout.grid.Rd | 29 +++++ man/layout.mds.Rd | 29 +++++ man/layout.merge.Rd | 23 ++++ man/layout.norm.Rd | 36 ++++++ man/layout.star.Rd | 24 ++++ man/layout.sugiyama.Rd | 52 +++++++++ man/layout_as_bipartite.Rd | 1 - man/layout_as_star.Rd | 1 - man/layout_nicely.Rd | 1 - man/layout_on_grid.Rd | 1 - man/layout_with_dh.Rd | 1 - man/layout_with_gem.Rd | 1 - man/layout_with_graphopt.Rd | 1 - man/layout_with_mds.Rd | 1 - man/layout_with_sugiyama.Rd | 1 - man/merge_coords.Rd | 2 - man/norm_coords.Rd | 1 - man/piecewise.layout.Rd | 23 ++++ 24 files changed, 605 insertions(+), 47 deletions(-) create mode 100644 man/layout.auto.Rd create mode 100644 man/layout.bipartite.Rd create mode 100644 man/layout.davidson.harel.Rd create mode 100644 man/layout.gem.Rd create mode 100644 man/layout.graphopt.Rd create mode 100644 man/layout.grid.Rd create mode 100644 man/layout.mds.Rd create mode 100644 man/layout.merge.Rd create mode 100644 man/layout.norm.Rd create mode 100644 man/layout.star.Rd create mode 100644 man/layout.sugiyama.Rd create mode 100644 man/piecewise.layout.Rd diff --git a/R/layout.R b/R/layout.R index fa25b32bdc3..fbf7dd8211b 100644 --- a/R/layout.R +++ b/R/layout.R @@ -1,4 +1,184 @@ +#' Merging graph layouts +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `piecewise.layout()` was renamed to `layout_components()` to create a more +#' consistent API. +#' @inheritParams layout_components +#' @keywords internal +#' @export +piecewise.layout <- function(graph , layout = layout_with_kk , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "piecewise.layout()", "layout_components()") + layout_components(graph = graph, layout = layout, ...) +} # nocov end + +#' The Sugiyama graph layout generator +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.sugiyama()` was renamed to `layout_with_sugiyama()` to create a more +#' consistent API. +#' @inheritParams layout_with_sugiyama +#' @keywords internal +#' @export +layout.sugiyama <- function(graph , layers = NULL , hgap = 1 , vgap = 1 , maxiter = 100 , weights = NULL , attributes = c("default","all","none")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.sugiyama()", "layout_with_sugiyama()") + layout_with_sugiyama(graph = graph, layers = layers, hgap = hgap, vgap = vgap, maxiter = maxiter, weights = weights, attributes = attributes) +} # nocov end + +#' Generate coordinates to place the vertices of a graph in a star-shape +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.star()` was renamed to `layout_as_star()` to create a more +#' consistent API. +#' @inheritParams layout_as_star +#' @keywords internal +#' @export +layout.star <- function(graph , center = V(graph)[1] , order = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.star()", "layout_as_star()") + layout_as_star(graph = graph, center = center, order = order) +} # nocov end + +#' Normalize coordinates for plotting graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.norm()` was renamed to `norm_coords()` to create a more +#' consistent API. +#' @inheritParams norm_coords +#' @keywords internal +#' @export +layout.norm <- function(layout , xmin = -1 , xmax = 1 , ymin = -1 , ymax = 1 , zmin = -1 , zmax = 1) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.norm()", "norm_coords()") + norm_coords(layout = layout, xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, zmin = zmin, zmax = zmax) +} # nocov end + +#' Merging graph layouts +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.merge()` was renamed to `merge_coords()` to create a more +#' consistent API. +#' @inheritParams merge_coords +#' @keywords internal +#' @export +layout.merge <- function(graphs , layouts , method = "dla") { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.merge()", "merge_coords()") + merge_coords(graphs = graphs, layouts = layouts, method = method) +} # nocov end + +#' Graph layout by multidimensional scaling +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.mds()` was renamed to `layout_with_mds()` to create a more +#' consistent API. +#' @inheritParams layout_with_mds +#' @keywords internal +#' @export +layout.mds <- function(graph , dist = NULL , dim = 2 , options = arpack_defaults()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.mds()", "layout_with_mds()") + layout_with_mds(graph = graph, dist = dist, dim = dim, options = options) +} # nocov end + +#' Simple grid layout +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.grid()` was renamed to `layout_on_grid()` to create a more +#' consistent API. +#' @inheritParams layout_on_grid +#' @keywords internal +#' @export +layout.grid <- function(graph , width = 0 , height = 0 , dim = 2) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.grid()", "layout_on_grid()") + layout_on_grid(graph = graph, width = width, height = height, dim = dim) +} # nocov end + +#' The graphopt layout algorithm +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.graphopt()` was renamed to `layout_with_graphopt()` to create a more +#' consistent API. +#' @inheritParams layout_with_graphopt +#' @keywords internal +#' @export +layout.graphopt <- function(graph , start = NULL , niter = 500 , charge = 0.001 , mass = 30 , spring.length = 0 , spring.constant = 1 , max.sa.movement = 5) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.graphopt()", "layout_with_graphopt()") + layout_with_graphopt(graph = graph, start = start, niter = niter, charge = charge, mass = mass, spring.length = spring.length, spring.constant = spring.constant, max.sa.movement = max.sa.movement) +} # nocov end + +#' The GEM layout algorithm +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.gem()` was renamed to `layout_with_gem()` to create a more +#' consistent API. +#' @inheritParams layout_with_gem +#' @keywords internal +#' @export +layout.gem <- function(graph , coords = NULL , maxiter = 40*vcount(graph)^2 , temp.max = max(vcount(graph),1) , temp.min = 1/10 , temp.init = sqrt(max(vcount(graph),1))) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.gem()", "layout_with_gem()") + layout_with_gem(graph = graph, coords = coords, maxiter = maxiter, temp.max = temp.max, temp.min = temp.min, temp.init = temp.init) +} # nocov end + +#' The Davidson-Harel layout algorithm +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.davidson.harel()` was renamed to `layout_with_dh()` to create a more +#' consistent API. +#' @inheritParams layout_with_dh +#' @keywords internal +#' @export +layout.davidson.harel <- function(graph , coords = NULL , maxiter = 10 , fineiter = max(10,log2(vcount(graph))) , cool.fact = 0.75 , weight.node.dist = 1.0 , weight.border = 0.0 , weight.edge.lengths = edge_density(graph)/10 , weight.edge.crossings = 1.0-sqrt(edge_density(graph)) , weight.node.edge.dist = 0.2*(1-edge_density(graph))) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.davidson.harel()", "layout_with_dh()") + layout_with_dh(graph = graph, coords = coords, maxiter = maxiter, fineiter = fineiter, cool.fact = cool.fact, weight.node.dist = weight.node.dist, weight.border = weight.border, weight.edge.lengths = weight.edge.lengths, weight.edge.crossings = weight.edge.crossings, weight.node.edge.dist = weight.node.edge.dist) +} # nocov end + +#' Simple two-row layout for bipartite graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.bipartite()` was renamed to `layout_as_bipartite()` to create a more +#' consistent API. +#' @inheritParams layout_as_bipartite +#' @keywords internal +#' @export +layout.bipartite <- function(graph , types = NULL , hgap = 1 , vgap = 1 , maxiter = 100) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.bipartite()", "layout_as_bipartite()") + layout_as_bipartite(graph = graph, types = types, hgap = hgap, vgap = vgap, maxiter = maxiter) +} # nocov end + +#' Choose an appropriate graph layout algorithm automatically +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `layout.auto()` was renamed to `layout_nicely()` to create a more +#' consistent API. +#' @inheritParams layout_nicely +#' @keywords internal +#' @export +layout.auto <- function(graph , dim = 2 , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "layout.auto()", "layout_nicely()") + layout_nicely(graph = graph, dim = dim, ...) +} # nocov end + ## ---------------------------------------------------------------- ## ## IGraph R package @@ -247,7 +427,6 @@ normalize <- function(xmin = -1, xmax = 1, ymin = xmin, ymax = xmax, #' edge crossings, using the Sugiyama algorithm (see #' [layout_with_sugiyama()]). #' -#' @aliases layout.bipartite #' @param graph The bipartite input graph. It should have a logical #' \sQuote{`type`} vertex attribute, or the `types` argument must be #' given. @@ -315,7 +494,6 @@ as_bipartite <- function(...) layout_spec(layout_as_bipartite, ...) #' It is possible to choose the vertex that will be in the center, and the #' order of the vertices can be also given. #' -#' @aliases layout.star #' @param graph The graph to layout. #' @param center The id of the vertex to put in the center. By default it is #' the first vertex. @@ -548,7 +726,6 @@ layout.circle <- function(..., params = list()) { #' forward the weights to these functions and issue a warning about this. You #' can use `weights = NA` to silence the warning. #' -#' @aliases layout.auto #' @param graph The input graph #' @param dim Dimensions, should be 2 or 3. #' @param \dots For `layout_nicely()` the extra arguments are passed to @@ -628,7 +805,7 @@ nicely <- function(...) layout_spec(layout_nicely, ...) #' other. If you want to change the order of the vertices, then see the #' [permute()] function. #' -#' @aliases layout.grid layout.grid.3d +#' @aliases layout.grid.3d #' @param graph The input graph. #' @param 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 @@ -820,7 +997,6 @@ layout.random <- function(..., params = list()) { #' possible. The only major difference is that coordinates are explicitly kept #' within the bounds of the rectangle of the layout. #' -#' @aliases layout.davidson.harel #' @param graph The graph to lay out. Edge directions are ignored. #' @param coords Optional starting positions for the vertices. If this argument #' is not `NULL` then it should be an appropriate matrix of starting @@ -1118,7 +1294,6 @@ layout.fruchterman.reingold <- function(..., params = list()) { #' #' See the referenced paper below for the details of the algorithm. #' -#' @aliases layout.gem #' @param graph The input graph. Edge directions are ignored. #' @param coords If not `NULL`, then the starting coordinates should be #' given here, in a two or three column matrix, depending on the `dim` @@ -1206,7 +1381,6 @@ with_gem <- function(...) layout_spec(layout_with_gem, ...) #' #' See also for the original graphopt. #' -#' @aliases layout.graphopt #' @param graph The input graph. #' @param start If given, then it should be a matrix with two columns and one #' line for each vertex. This matrix will be used as starting positions for the @@ -1492,7 +1666,6 @@ layout.lgl <- function(..., params = list()) { #' This function generates the layout separately for each graph component and #' then merges them via [merge_coords()]. #' -#' @aliases layout.mds #' @param graph The input graph. #' @param dist The distance matrix for the multidimensional scaling. If #' `NULL` (the default), then the unweighted shortest path matrix is used. @@ -1575,7 +1748,6 @@ with_mds <- function(...) layout_spec(layout_with_mds, ...) #' #' For more details, see the reference below. #' -#' @aliases layout.sugiyama #' @param graph The input graph. #' @param layers A numeric vector or `NULL`. If not `NULL`, then it #' should specify the layer index of the vertices. Layers are numbered from @@ -1906,7 +2078,6 @@ with_sugiyama <- function(...) layout_spec(layout_with_sugiyama, ...) #' for each component separately. Finally it merges the layouts via calling #' `merge_coords()`. #' -#' @aliases layout.merge piecewise.layout #' @param graphs A list of graph objects. #' @param layouts A list of two-column matrices. #' @param method Character constant giving the method to use. Right now only @@ -1956,7 +2127,6 @@ merge_coords <- function(graphs, layouts, method = "dla") { #' `norm_coords()` normalizes a layout, it linearly transforms each #' coordinate separately to fit into the given limits. #' -#' @aliases layout.norm #' @param layout A matrix with two or three columns, the layout to normalize. #' @param xmin,xmax The limits for the first coordinate, if one of them or both #' are `NULL` then no normalization is performed along this direction. @@ -2006,7 +2176,6 @@ norm_coords <- function(layout, xmin = -1, xmax = 1, ymin = -1, ymax = 1, } #' @rdname merge_coords -#' @aliases piecewise.layout #' @param graph The input graph. #' @export layout_components <- function(graph, layout = layout_with_kk, ...) { @@ -2066,26 +2235,3 @@ layout.fruchterman.reingold.grid <- function(graph, ...) { layout_with_fr(graph) } #' @export layout.auto -deprecated("layout.auto", layout_nicely) -#' @export layout.bipartite -deprecated("layout.bipartite", layout_as_bipartite) -#' @export layout.davidson.harel -deprecated("layout.davidson.harel", layout_with_dh) -#' @export layout.gem -deprecated("layout.gem", layout_with_gem) -#' @export layout.graphopt -deprecated("layout.graphopt", layout_with_graphopt) -#' @export layout.grid -deprecated("layout.grid", layout_on_grid) -#' @export layout.mds -deprecated("layout.mds", layout_with_mds) -#' @export layout.merge -deprecated("layout.merge", merge_coords) -#' @export layout.norm -deprecated("layout.norm", norm_coords) -#' @export layout.star -deprecated("layout.star", layout_as_star) -#' @export layout.sugiyama -deprecated("layout.sugiyama", layout_with_sugiyama) -#' @export piecewise.layout -deprecated("piecewise.layout", layout_components) diff --git a/man/layout.auto.Rd b/man/layout.auto.Rd new file mode 100644 index 00000000000..a95c4e0b3b4 --- /dev/null +++ b/man/layout.auto.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.auto} +\alias{layout.auto} +\title{Choose an appropriate graph layout algorithm automatically} +\usage{ +layout.auto(graph, dim = 2, ...) +} +\arguments{ +\item{graph}{The input graph} + +\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()}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.auto()} was renamed to \code{layout_nicely()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.bipartite.Rd b/man/layout.bipartite.Rd new file mode 100644 index 00000000000..ae9bc139b69 --- /dev/null +++ b/man/layout.bipartite.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.bipartite} +\alias{layout.bipartite} +\title{Simple two-row layout for bipartite graphs} +\usage{ +layout.bipartite(graph, types = NULL, hgap = 1, vgap = 1, maxiter = 100) +} +\arguments{ +\item{graph}{The bipartite input graph. It should have a logical +\sQuote{\code{type}} vertex attribute, or the \code{types} argument must be +given.} + +\item{types}{A logical vector, the vertex types. If this argument is +\code{NULL} (the default), then the \sQuote{\code{type}} vertex attribute is +used.} + +\item{hgap}{Real scalar, the minimum horizontal gap between vertices in the +same layer.} + +\item{vgap}{Real scalar, the distance between the two layers.} + +\item{maxiter}{Integer scalar, the maximum number of iterations in the +crossing minimization stage. 100 is a reasonable default; if you feel that +you have too many edge crossings, increase this.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.bipartite()} was renamed to \code{layout_as_bipartite()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.davidson.harel.Rd b/man/layout.davidson.harel.Rd new file mode 100644 index 00000000000..c961a4cd8d2 --- /dev/null +++ b/man/layout.davidson.harel.Rd @@ -0,0 +1,55 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.davidson.harel} +\alias{layout.davidson.harel} +\title{The Davidson-Harel layout algorithm} +\usage{ +layout.davidson.harel( + graph, + coords = NULL, + maxiter = 10, + fineiter = max(10, log2(vcount(graph))), + cool.fact = 0.75, + weight.node.dist = 1, + weight.border = 0, + weight.edge.lengths = edge_density(graph)/10, + weight.edge.crossings = 1 - sqrt(edge_density(graph)), + weight.node.edge.dist = 0.2 * (1 - edge_density(graph)) +) +} +\arguments{ +\item{graph}{The graph to lay out. Edge directions are ignored.} + +\item{coords}{Optional starting positions for the vertices. If this argument +is not \code{NULL} then it should be an appropriate matrix of starting +coordinates.} + +\item{maxiter}{Number of iterations to perform in the first phase.} + +\item{fineiter}{Number of iterations in the fine tuning phase.} + +\item{cool.fact}{Cooling factor.} + +\item{weight.node.dist}{Weight for the node-node distances component of the +energy function.} + +\item{weight.border}{Weight for the distance from the border component of +the energy function. It can be set to zero, if vertices are allowed to sit +on the border.} + +\item{weight.edge.lengths}{Weight for the edge length component of the +energy function.} + +\item{weight.edge.crossings}{Weight for the edge crossing component of the +energy function.} + +\item{weight.node.edge.dist}{Weight for the node-edge distance component of +the energy function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.davidson.harel()} was renamed to \code{layout_with_dh()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.gem.Rd b/man/layout.gem.Rd new file mode 100644 index 00000000000..a53adc0ca87 --- /dev/null +++ b/man/layout.gem.Rd @@ -0,0 +1,44 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.gem} +\alias{layout.gem} +\title{The GEM layout algorithm} +\usage{ +layout.gem( + graph, + coords = NULL, + maxiter = 40 * vcount(graph)^2, + temp.max = max(vcount(graph), 1), + temp.min = 1/10, + temp.init = sqrt(max(vcount(graph), 1)) +) +} +\arguments{ +\item{graph}{The input graph. Edge directions are ignored.} + +\item{coords}{If not \code{NULL}, then the starting coordinates should be +given here, in a two or three column matrix, depending on the \code{dim} +argument.} + +\item{maxiter}{The maximum number of iterations to perform. Updating a +single vertex counts as an iteration. A reasonable default is 40 * n * n, +where n is the number of vertices. The original paper suggests 4 * n * n, +but this usually only works if the other parameters are set up carefully.} + +\item{temp.max}{The maximum allowed local temperature. A reasonable default +is the number of vertices.} + +\item{temp.min}{The global temperature at which the algorithm terminates +(even before reaching \code{maxiter} iterations). A reasonable default is +1/10.} + +\item{temp.init}{Initial local temperature of all vertices. A reasonable +default is the square root of the number of vertices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.gem()} was renamed to \code{layout_with_gem()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.graphopt.Rd b/man/layout.graphopt.Rd new file mode 100644 index 00000000000..05bd52f4bc9 --- /dev/null +++ b/man/layout.graphopt.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.graphopt} +\alias{layout.graphopt} +\title{The graphopt layout algorithm} +\usage{ +layout.graphopt( + graph, + start = NULL, + niter = 500, + charge = 0.001, + mass = 30, + spring.length = 0, + spring.constant = 1, + max.sa.movement = 5 +) +} +\arguments{ +\item{graph}{The input graph.} + +\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 +algorithm. If not given, then a random starting matrix is used.} + +\item{niter}{Integer scalar, the number of iterations to perform. Should be +a couple of hundred in general. If you have a large graph then you might +want to only do a few iterations and then check the result. If it is not +good enough you can feed it in again in the \code{start} argument. The +default value is 500.} + +\item{charge}{The charge of the vertices, used to calculate electric +repulsion. The default is 0.001.} + +\item{mass}{The mass of the vertices, used for the spring forces. The +default is 30.} + +\item{spring.length}{The length of the springs, an integer number. The +default value is zero.} + +\item{spring.constant}{The spring constant, the default value is one.} + +\item{max.sa.movement}{Real constant, it gives the maximum amount of +movement allowed in a single step along a single axis. The default value is +5.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.graphopt()} was renamed to \code{layout_with_graphopt()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.grid.Rd b/man/layout.grid.Rd new file mode 100644 index 00000000000..b964807d7f5 --- /dev/null +++ b/man/layout.grid.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.grid} +\alias{layout.grid} +\title{Simple grid layout} +\usage{ +layout.grid(graph, width = 0, height = 0, dim = 2) +} +\arguments{ +\item{graph}{The input graph.} + +\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 +square root of the number of vertices in the graph, rounded up to the next +integer. Similarly, it will be the cube root for 3d layouts.} + +\item{height}{The number of vertices in a single column of the grid, for +three dimensional layouts. If this is zero or negative, then it is +determinted automatically.} + +\item{dim}{Two or three. Whether to make 2d or a 3d layout.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.grid()} was renamed to \code{layout_on_grid()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.mds.Rd b/man/layout.mds.Rd new file mode 100644 index 00000000000..bfc263b9599 --- /dev/null +++ b/man/layout.mds.Rd @@ -0,0 +1,29 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.mds} +\alias{layout.mds} +\title{Graph layout by multidimensional scaling} +\usage{ +layout.mds(graph, dist = NULL, dim = 2, options = arpack_defaults()) +} +\arguments{ +\item{graph}{The input graph.} + +\item{dist}{The distance matrix for the multidimensional scaling. If +\code{NULL} (the default), then the unweighted shortest path matrix is used.} + +\item{dim}{\code{layout_with_mds()} supports dimensions up to the number of nodes +minus one, but only if the graph is connected; for unconnected graphs, the +only possible value is 2. This is because \code{merge_coords()} only works in +2D.} + +\item{options}{This is currently ignored, as ARPACK is not used any more for +solving the eigenproblem} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.mds()} was renamed to \code{layout_with_mds()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.merge.Rd b/man/layout.merge.Rd new file mode 100644 index 00000000000..c8306f5e565 --- /dev/null +++ b/man/layout.merge.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.merge} +\alias{layout.merge} +\title{Merging graph layouts} +\usage{ +layout.merge(graphs, layouts, method = "dla") +} +\arguments{ +\item{graphs}{A list of graph objects.} + +\item{layouts}{A list of two-column matrices.} + +\item{method}{Character constant giving the method to use. Right now only +\code{dla} is implemented.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.merge()} was renamed to \code{merge_coords()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.norm.Rd b/man/layout.norm.Rd new file mode 100644 index 00000000000..711b13ea28f --- /dev/null +++ b/man/layout.norm.Rd @@ -0,0 +1,36 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.norm} +\alias{layout.norm} +\title{Normalize coordinates for plotting graphs} +\usage{ +layout.norm( + layout, + xmin = -1, + xmax = 1, + ymin = -1, + ymax = 1, + zmin = -1, + zmax = 1 +) +} +\arguments{ +\item{layout}{A matrix with two or three columns, the layout to normalize.} + +\item{xmin, xmax}{The limits for the first coordinate, if one of them or both +are \code{NULL} then no normalization is performed along this direction.} + +\item{ymin, ymax}{The limits for the second coordinate, if one of them or +both are \code{NULL} then no normalization is performed along this +direction.} + +\item{zmin, zmax}{The limits for the third coordinate, if one of them or both +are \code{NULL} then no normalization is performed along this direction.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.norm()} was renamed to \code{norm_coords()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.star.Rd b/man/layout.star.Rd new file mode 100644 index 00000000000..25364c9e18c --- /dev/null +++ b/man/layout.star.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.star} +\alias{layout.star} +\title{Generate coordinates to place the vertices of a graph in a star-shape} +\usage{ +layout.star(graph, center = V(graph)[1], order = NULL) +} +\arguments{ +\item{graph}{The graph to layout.} + +\item{center}{The id of the vertex to put in the center. By default it is +the first vertex.} + +\item{order}{Numeric vector, the order of the vertices along the perimeter. +The default ordering is given by the vertex ids.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.star()} was renamed to \code{layout_as_star()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout.sugiyama.Rd b/man/layout.sugiyama.Rd new file mode 100644 index 00000000000..fc925431459 --- /dev/null +++ b/man/layout.sugiyama.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{layout.sugiyama} +\alias{layout.sugiyama} +\title{The Sugiyama graph layout generator} +\usage{ +layout.sugiyama( + graph, + layers = NULL, + hgap = 1, + vgap = 1, + maxiter = 100, + weights = NULL, + attributes = c("default", "all", "none") +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{layers}{A numeric vector or \code{NULL}. If not \code{NULL}, then it +should specify the layer index of the vertices. Layers are numbered from +one. If \code{NULL}, then igraph calculates the layers automatically.} + +\item{hgap}{Real scalar, the minimum horizontal gap between vertices in the +same layer.} + +\item{vgap}{Real scalar, the distance between layers.} + +\item{maxiter}{Integer scalar, the maximum number of iterations in the +crossing minimization stage. 100 is a reasonable default; if you feel that +you have too many edge crossings, increase this.} + +\item{weights}{Optional edge weight vector. If \code{NULL}, then the +'weight' edge attribute is used, if there is one. Supply \code{NA} here and +igraph ignores the edge weights. These are used only if the graph +contains cycles; igraph will tend to reverse edges with smaller weights +when breaking the cycles.} + +\item{attributes}{Which graph/vertex/edge attributes to keep in the extended +graph. \sQuote{default} keeps the \sQuote{size}, \sQuote{size2}, +\sQuote{shape}, \sQuote{label} and \sQuote{color} vertex attributes and the +\sQuote{arrow.mode} and \sQuote{arrow.size} edge attributes. \sQuote{all} +keep all graph, vertex and edge attributes, \sQuote{none} keeps none of +them.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{layout.sugiyama()} was renamed to \code{layout_with_sugiyama()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/layout_as_bipartite.Rd b/man/layout_as_bipartite.Rd index b4853a2809d..1cc68a1d3e1 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{layout.bipartite} \alias{as_bipartite} \title{Simple two-row layout for bipartite graphs} \usage{ diff --git a/man/layout_as_star.Rd b/man/layout_as_star.Rd index dd8faac6dde..605d43a2bf4 100644 --- a/man/layout_as_star.Rd +++ b/man/layout_as_star.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_as_star} \alias{layout_as_star} -\alias{layout.star} \alias{as_star} \title{Generate coordinates to place the vertices of a graph in a star-shape} \usage{ diff --git a/man/layout_nicely.Rd b/man/layout_nicely.Rd index ac77f47b27a..fc08b8ead52 100644 --- a/man/layout_nicely.Rd +++ b/man/layout_nicely.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_nicely} \alias{layout_nicely} -\alias{layout.auto} \alias{nicely} \title{Choose an appropriate graph layout algorithm automatically} \usage{ diff --git a/man/layout_on_grid.Rd b/man/layout_on_grid.Rd index 6f14eb395b6..e0b5f09b8f3 100644 --- a/man/layout_on_grid.Rd +++ b/man/layout_on_grid.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_on_grid} \alias{layout_on_grid} -\alias{layout.grid} \alias{layout.grid.3d} \alias{on_grid} \title{Simple grid layout} diff --git a/man/layout_with_dh.Rd b/man/layout_with_dh.Rd index d5f915aa960..4435e3986a6 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{layout.davidson.harel} \alias{with_dh} \title{The Davidson-Harel layout algorithm} \usage{ diff --git a/man/layout_with_gem.Rd b/man/layout_with_gem.Rd index a37f65f777d..971eb697cfe 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{layout.gem} \alias{with_gem} \title{The GEM layout algorithm} \usage{ diff --git a/man/layout_with_graphopt.Rd b/man/layout_with_graphopt.Rd index 66d25a84678..750de8fb747 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{layout.graphopt} \alias{with_graphopt} \title{The graphopt layout algorithm} \usage{ diff --git a/man/layout_with_mds.Rd b/man/layout_with_mds.Rd index d21994cdd8f..6e17f489a2a 100644 --- a/man/layout_with_mds.Rd +++ b/man/layout_with_mds.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{layout_with_mds} \alias{layout_with_mds} -\alias{layout.mds} \alias{with_mds} \title{Graph layout by multidimensional scaling} \usage{ diff --git a/man/layout_with_sugiyama.Rd b/man/layout_with_sugiyama.Rd index a913df1de62..9c571d1838b 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{layout.sugiyama} \alias{with_sugiyama} \title{The Sugiyama graph layout generator} \usage{ diff --git a/man/merge_coords.Rd b/man/merge_coords.Rd index 04fd7aa27dd..5fef2d5ad73 100644 --- a/man/merge_coords.Rd +++ b/man/merge_coords.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/layout.R \name{merge_coords} \alias{merge_coords} -\alias{layout.merge} -\alias{piecewise.layout} \alias{layout_components} \title{Merging graph layouts} \usage{ diff --git a/man/norm_coords.Rd b/man/norm_coords.Rd index c85209293c8..106ed617ebc 100644 --- a/man/norm_coords.Rd +++ b/man/norm_coords.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/layout.R \name{norm_coords} \alias{norm_coords} -\alias{layout.norm} \title{Normalize coordinates for plotting graphs} \usage{ norm_coords( diff --git a/man/piecewise.layout.Rd b/man/piecewise.layout.Rd new file mode 100644 index 00000000000..b65fc7c4d36 --- /dev/null +++ b/man/piecewise.layout.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/layout.R +\name{piecewise.layout} +\alias{piecewise.layout} +\title{Merging graph layouts} +\usage{ +piecewise.layout(graph, layout = layout_with_kk, ...) +} +\arguments{ +\item{graph}{The input graph.} + +\item{layout}{A function object, the layout function to use.} + +\item{...}{Additional arguments to pass to the \code{layout} layout +function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{piecewise.layout()} was renamed to \code{layout_components()} to create a more +consistent API. +} +\keyword{internal} From 728acd7445c25d7aed3c0679e8d2307ffbd07cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:05:58 +0100 Subject: [PATCH 31/48] refactor!: change R/make.R --- R/make.R | 341 ++++++++++++++++++++++++----- man/graph.Rd | 61 ++++++ man/graph.atlas.Rd | 18 ++ man/graph.bipartite.Rd | 30 +++ man/graph.de.bruijn.Rd | 20 ++ man/graph.empty.Rd | 20 ++ man/graph.extended.chordal.ring.Rd | 23 ++ man/graph.famous.Rd | 61 ++++++ man/graph.formula.Rd | 24 ++ man/graph.full.Rd | 22 ++ man/graph.full.bipartite.Rd | 28 +++ man/graph.full.citation.Rd | 20 ++ man/graph.kautz.Rd | 20 ++ man/graph.lattice.Rd | 43 ++++ man/graph.lcf.Rd | 22 ++ man/graph.ring.Rd | 27 +++ man/graph.star.Rd | 26 +++ man/graph.tree.Rd | 27 +++ man/graph_from_atlas.Rd | 1 - man/graph_from_lcf.Rd | 1 - man/graph_from_literal.Rd | 1 - man/line.graph.Rd | 18 ++ man/make_bipartite_graph.Rd | 2 - man/make_chordal_ring.Rd | 1 - man/make_de_bruijn_graph.Rd | 1 - man/make_empty_graph.Rd | 1 - man/make_full_bipartite_graph.Rd | 1 - man/make_full_citation_graph.Rd | 1 - man/make_full_graph.Rd | 1 - man/make_graph.Rd | 2 - man/make_kautz_graph.Rd | 1 - man/make_lattice.Rd | 1 - man/make_line_graph.Rd | 1 - man/make_ring.Rd | 1 - man/make_star.Rd | 1 - man/make_tree.Rd | 1 - 36 files changed, 799 insertions(+), 71 deletions(-) create mode 100644 man/graph.Rd create mode 100644 man/graph.atlas.Rd create mode 100644 man/graph.bipartite.Rd create mode 100644 man/graph.de.bruijn.Rd create mode 100644 man/graph.empty.Rd create mode 100644 man/graph.extended.chordal.ring.Rd create mode 100644 man/graph.famous.Rd create mode 100644 man/graph.formula.Rd create mode 100644 man/graph.full.Rd create mode 100644 man/graph.full.bipartite.Rd create mode 100644 man/graph.full.citation.Rd create mode 100644 man/graph.kautz.Rd create mode 100644 man/graph.lattice.Rd create mode 100644 man/graph.lcf.Rd create mode 100644 man/graph.ring.Rd create mode 100644 man/graph.star.Rd create mode 100644 man/graph.tree.Rd create mode 100644 man/line.graph.Rd diff --git a/R/make.R b/R/make.R index 5fb67ada124..73cd81f5426 100644 --- a/R/make.R +++ b/R/make.R @@ -1,4 +1,292 @@ +#' Create an igraph graph from a list of edges, or a notable graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph()` was renamed to `make_graph()` to create a more +#' consistent API. +#' @inheritParams make_graph +#' @keywords internal +#' @export +graph <- function(edges , ... , n = max(edges) , isolates = NULL , directed = TRUE , dir = directed , simplify = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph()", "make_graph()") + + if (!missing(dir) && missing(directed)) { + directed <- dir + } + + if (missing(simplify)) { + make_graph(edges = edges, n = n, isolates = isolates, directed = directed, ...) + } else { + make_graph(edges = edges, n = n, isolates = isolates, directed = directed, simplify = simplify, ...) + } +} # nocov end + +#' Create an igraph graph from a list of edges, or a notable graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.famous()` was renamed to `make_graph()` to create a more +#' consistent API. +#' @inheritParams make_graph +#' @keywords internal +#' @export +graph.famous <- function(edges , ... , n = max(edges) , isolates = NULL , directed = TRUE , dir = directed , simplify = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.famous()", "make_graph()") + + if (!missing(dir) && missing(directed)) { + directed <- dir + } + + if (missing(simplify)) { + make_graph(edges = edges, n = n, isolates = isolates, directed = directed, ...) + } else { + make_graph(edges = edges, n = n, isolates = isolates, directed = directed, simplify = simplify, ...) + } +} # nocov end + +#' Line graph of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `line.graph()` was renamed to `make_line_graph()` to create a more +#' consistent API. +#' @inheritParams make_line_graph +#' @keywords internal +#' @export +line.graph <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "line.graph()", "make_line_graph()") + make_line_graph(graph = graph) +} # nocov end + +#' Create a ring graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.ring()` was renamed to `make_ring()` to create a more +#' consistent API. +#' @inheritParams make_ring +#' @keywords internal +#' @export +graph.ring <- function(n , directed = FALSE , mutual = FALSE , circular = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.ring()", "make_ring()") + make_ring(n = n, directed = directed, mutual = mutual, circular = circular) +} # nocov end + +#' Create tree graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.tree()` was renamed to `make_tree()` to create a more +#' consistent API. +#' @inheritParams make_tree +#' @keywords internal +#' @export +graph.tree <- function(n , children = 2 , mode = c("out","in","undirected")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.tree()", "make_tree()") + make_tree(n = n, children = children, mode = mode) +} # nocov end + +#' Create a star graph, a tree with n vertices and n - 1 leaves +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.star()` was renamed to `make_star()` to create a more +#' consistent API. +#' @inheritParams make_star +#' @keywords internal +#' @export +graph.star <- function(n , mode = c("in","out","mutual","undirected") , center = 1) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.star()", "make_star()") + make_star(n = n, mode = mode, center = center) +} # nocov end + +#' Creating a graph from LCF notation +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.lcf()` was renamed to `graph_from_lcf()` to create a more +#' consistent API. +#' @inheritParams graph_from_lcf +#' @keywords internal +#' @export +graph.lcf <- function(n , shifts , repeats = 1) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.lcf()", "graph_from_lcf()") + graph_from_lcf(n = n, shifts = shifts, repeats = repeats) +} # nocov end + +#' Create a lattice graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.lattice()` was renamed to `make_lattice()` to create a more +#' consistent API. +#' @inheritParams make_lattice +#' @keywords internal +#' @export +graph.lattice <- function(dimvector = NULL , length = NULL , dim = NULL , nei = 1 , directed = FALSE , mutual = FALSE , circular = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.lattice()", "make_lattice()") + make_lattice(dimvector = dimvector, length = length, dim = dim, nei = nei, directed = directed, mutual = mutual, circular = circular) +} # nocov end + +#' Kautz graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.kautz()` was renamed to `make_kautz_graph()` to create a more +#' consistent API. +#' @inheritParams make_kautz_graph +#' @keywords internal +#' @export +graph.kautz <- function(m , n) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.kautz()", "make_kautz_graph()") + make_kautz_graph(m = m, n = n) +} # nocov end + +#' Create a complete (full) citation graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.full.citation()` was renamed to `make_full_citation_graph()` to create a more +#' consistent API. +#' @inheritParams make_full_citation_graph +#' @keywords internal +#' @export +graph.full.citation <- function(n , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.full.citation()", "make_full_citation_graph()") + make_full_citation_graph(n = n, directed = directed) +} # nocov end + +#' Create a full bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.full.bipartite()` was renamed to `make_full_bipartite_graph()` to create a more +#' consistent API. +#' @inheritParams make_full_bipartite_graph +#' @keywords internal +#' @export +graph.full.bipartite <- function(n1 , n2 , directed = FALSE , mode = c("all","out","in")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.full.bipartite()", "make_full_bipartite_graph()") + make_full_bipartite_graph(n1 = n1, n2 = n2, directed = directed, mode = mode) +} # nocov end + +#' Create a full graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.full()` was renamed to `make_full_graph()` to create a more +#' consistent API. +#' @inheritParams make_full_graph +#' @keywords internal +#' @export +graph.full <- function(n , directed = FALSE , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.full()", "make_full_graph()") + make_full_graph(n = n, directed = directed, loops = loops) +} # nocov end + +#' Creating (small) graphs via a simple interface +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.formula()` was renamed to `graph_from_literal()` to create a more +#' consistent API. +#' @inheritParams graph_from_literal +#' @keywords internal +#' @export +graph.formula <- function(... , simplify = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.formula()", "graph_from_literal()") + graph_from_literal(simplify = simplify, ...) +} # nocov end + +#' Create an extended chordal ring graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.extended.chordal.ring()` was renamed to `make_chordal_ring()` to create a more +#' consistent API. +#' @inheritParams make_chordal_ring +#' @keywords internal +#' @export +graph.extended.chordal.ring <- function(n , w , directed = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.extended.chordal.ring()", "make_chordal_ring()") + make_chordal_ring(n = n, w = w, directed = directed) +} # nocov end + +#' A graph with no edges +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.empty()` was renamed to `make_empty_graph()` to create a more +#' consistent API. +#' @inheritParams make_empty_graph +#' @keywords internal +#' @export +graph.empty <- function(n = 0 , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.empty()", "make_empty_graph()") + make_empty_graph(n = n, directed = directed) +} # nocov end + +#' De Bruijn graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.de.bruijn()` was renamed to `make_de_bruijn_graph()` to create a more +#' consistent API. +#' @inheritParams make_de_bruijn_graph +#' @keywords internal +#' @export +graph.de.bruijn <- function(m , n) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.de.bruijn()", "make_de_bruijn_graph()") + make_de_bruijn_graph(m = m, n = n) +} # nocov end + +#' Create a bipartite graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.bipartite()` was renamed to `make_bipartite_graph()` to create a more +#' consistent API. +#' @inheritParams make_bipartite_graph +#' @keywords internal +#' @export +graph.bipartite <- function(types , edges , directed = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.bipartite()", "make_bipartite_graph()") + make_bipartite_graph(types = types, edges = edges, directed = directed) +} # nocov end + +#' Create a graph from the Graph Atlas +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.atlas()` was renamed to `graph_from_atlas()` to create a more +#' consistent API. +#' @inheritParams graph_from_atlas +#' @keywords internal +#' @export +graph.atlas <- function(n) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.atlas()", "graph_from_atlas()") + graph_from_atlas(n = n) +} # nocov end + ## ---------------------------------------------------------------- ## ## IGraph R package @@ -506,7 +794,6 @@ with_graph_ <- function(...) { #' groups, Journal of Anthropological Research 33, 452-473 (1977). } } #' #' @encoding UTF-8 -#' @aliases graph.famous graph #' @param edges A vector defining the edges, the first edge points #' from the first element to the second, the second edge from the third #' to the fourth, etc. For a numeric vector, these are interpreted @@ -687,7 +974,6 @@ undirected_graph <- function(...) constructor_spec(make_undirected_graph, ...) #' A graph with no edges #' -#' @aliases graph.empty #' @concept Empty graph. #' @param n Number of vertices. #' @param directed Whether to create a directed graph. @@ -797,7 +1083,6 @@ empty_graph <- function(...) constructor_spec(make_empty_graph, ...) #' #' See more examples below. #' -#' @aliases graph.formula #' @param ... For `graph_from_literal()` the formulae giving the #' structure of the graph, see details below. For `from_literal()` #' all arguments are passed to `graph_from_literal()`. @@ -959,7 +1244,6 @@ from_literal <- function(...) { #' `star()` creates a star graph, in this every single vertex is #' connected to the center vertex and nobody else. #' -#' @aliases graph.star #' @concept Star graph #' @param n Number of vertices. #' @param mode It defines the direction of the @@ -1011,7 +1295,6 @@ star <- function(...) constructor_spec(make_star, ...) #' Create a full graph #' -#' @aliases graph.full #' @concept Full graph #' @param n Number of vertices. #' @param directed Whether to create a directed graph. @@ -1051,7 +1334,6 @@ full_graph <- function(...) constructor_spec(make_full_graph, ...) #' `length` and `dim`. In the second form you omit #' `dimvector` and supply `length` and `dim`. #' -#' @aliases graph.lattice #' @concept Lattice #' @param dimvector A vector giving the size of the lattice in each #' dimension. @@ -1112,7 +1394,6 @@ lattice <- function(...) constructor_spec(make_lattice, ...) #' A ring is a one-dimensional lattice and this function is a special case #' of [make_lattice()]. #' -#' @aliases graph.ring #' @param n Number of vertices. #' @param directed Whether the graph is directed. #' @param mutual Whether directed edges are mutual. It is ignored in @@ -1153,7 +1434,6 @@ ring <- function(...) constructor_spec(make_ring, ...) #' Create a k-ary tree graph, where almost all vertices other than the leaves #' have the same number of children. #' -#' @aliases graph.tree #' @concept Trees. #' @param n Number of vertices. #' @param children Integer scalar, the number of children of a vertex @@ -1275,7 +1555,6 @@ from_prufer <- function(...) constructor_spec(make_from_prufer, ...) #' automorphisms. #' } #' -#' @aliases graph.atlas #' @concept Graph Atlas. #' @param n The id of the graph to create. #' @return An igraph graph. @@ -1317,7 +1596,6 @@ atlas <- function(...) constructor_spec(graph_from_atlas, ...) #' of total nodes. See also Kotsis, G: Interconnection Topologies for #' Parallel Processing Systems, PARS Mitteilungen 11, 1-6, 1993. #' -#' @aliases graph.extended.chordal.ring #' @param n The number of vertices. #' @param w A matrix which specifies the extended chordal ring. See #' details below. @@ -1366,7 +1644,6 @@ chordal_ring <- function(...) constructor_spec(make_chordal_ring, ...) #' the first vertex's corresponding edge is the same as the source of the #' second vertex's corresponding edge. #' -#' @aliases line.graph #' @param graph The input graph, it can be directed or undirected. #' @return A new graph object. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com}, the first version of @@ -1417,7 +1694,6 @@ line_graph <- function(...) constructor_spec(make_line_graph, ...) #' De Bruijn graphs have some interesting properties, please see another #' source, e.g. Wikipedia for details. #' -#' @aliases graph.de.bruijn #' @param m Integer scalar, the size of the alphabet. See details below. #' @param n Integer scalar, the length of the labels. See details below. #' @return A graph object. @@ -1463,7 +1739,6 @@ de_bruijn_graph <- function(...) constructor_spec(make_de_bruijn_graph, ...) #' Kautz graphs have some interesting properties, see e.g. Wikipedia for #' details. #' -#' @aliases graph.kautz #' @param m Integer scalar, the size of the alphabet. See details below. #' @param n Integer scalar, the length of the labels. See details below. #' @return A graph object. @@ -1504,7 +1779,6 @@ kautz_graph <- function(...) constructor_spec(make_kautz_graph, ...) #' this is boolean and `FALSE` for the vertices of the first kind and #' `TRUE` for vertices of the second kind. #' -#' @aliases graph.full.bipartite #' @param n1 The number of vertices of the first kind. #' @param n2 The number of vertices of the second kind. #' @param directed Logical scalar, whether the graphs is directed. @@ -1574,7 +1848,6 @@ full_bipartite_graph <- function(...) constructor_spec(make_full_bipartite_graph #' `is_bipartite()` checks whether the graph is bipartite or not. It just #' checks whether the graph has a vertex attribute called `type`. #' -#' @aliases graph.bipartite is.bipartite #' @param types A vector giving the vertex types. It will be coerced into #' boolean. The length of the vector gives the number of vertices in the graph. #' When the vector is a named vector, the names will be attached to the graph @@ -1642,7 +1915,6 @@ bipartite_graph <- function(...) constructor_spec(make_bipartite_graph, ...) #' directed graph, where every `i->j` edge is present if and only if #' \eqn{j Date: Mon, 4 Dec 2023 15:06:32 +0100 Subject: [PATCH 32/48] refactor!: change R/minimum.spanning.tree.R --- R/minimum.spanning.tree.R | 17 +++++++++++++++-- man/minimum.spanning.tree.Rd | 32 ++++++++++++++++++++++++++++++++ man/mst.Rd | 1 - 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 man/minimum.spanning.tree.Rd diff --git a/R/minimum.spanning.tree.R b/R/minimum.spanning.tree.R index 3c0ed5c1088..aed2cf17471 100644 --- a/R/minimum.spanning.tree.R +++ b/R/minimum.spanning.tree.R @@ -1,3 +1,18 @@ + +#' Minimum spanning tree +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `minimum.spanning.tree()` was renamed to `mst()` to create a more +#' consistent API. +#' @inheritParams mst +#' @keywords internal +#' @export +minimum.spanning.tree <- function(graph , weights = NULL , algorithm = NULL , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "minimum.spanning.tree()", "mst()") + mst(graph = graph, weights = weights, algorithm = algorithm, ...) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -33,7 +48,6 @@ #' #' If the graph is not connected a minimum spanning forest is returned. #' -#' @aliases minimum.spanning.tree #' @param graph The graph object to analyze. #' @param weights Numeric vector giving the weights of the edges in the #' graph. The order is determined by the edge ids. This is ignored if the @@ -90,4 +104,3 @@ mst <- function(graph, weights = NULL, } } #' @export minimum.spanning.tree -deprecated("minimum.spanning.tree", mst) diff --git a/man/minimum.spanning.tree.Rd b/man/minimum.spanning.tree.Rd new file mode 100644 index 00000000000..03961542ca8 --- /dev/null +++ b/man/minimum.spanning.tree.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/minimum.spanning.tree.R +\name{minimum.spanning.tree} +\alias{minimum.spanning.tree} +\title{Minimum spanning tree} +\usage{ +minimum.spanning.tree(graph, weights = NULL, algorithm = NULL, ...) +} +\arguments{ +\item{graph}{The graph object to analyze.} + +\item{weights}{Numeric vector giving the weights of the edges in the +graph. The order is determined by the edge ids. This is ignored if the +\code{unweighted} algorithm is chosen. Edge weights are interpreted as +distances.} + +\item{algorithm}{The algorithm to use for calculation. \code{unweighted} can +be used for unweighted graphs, and \code{prim} runs Prim's algorithm for +weighted graphs. If this is \code{NULL} then igraph will select the +algorithm automatically: if the graph has an edge attribute called +\code{weight} or the \code{weights} argument is not \code{NULL} then Prim's +algorithm is chosen, otherwise the unweighted algorithm is used.} + +\item{...}{Additional arguments, unused.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{minimum.spanning.tree()} was renamed to \code{mst()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/mst.Rd b/man/mst.Rd index bcea7ac5d9b..686678e50e3 100644 --- a/man/mst.Rd +++ b/man/mst.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/minimum.spanning.tree.R \name{mst} \alias{mst} -\alias{minimum.spanning.tree} \title{Minimum spanning tree} \usage{ mst(graph, weights = NULL, algorithm = NULL, ...) From 516afc1bcc7776c955db9deffffb53113999ac0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:07:15 +0100 Subject: [PATCH 33/48] refactor!: change R/motifs.R --- R/motifs.R | 89 ++++++++++++++++++++++++++++++++++------- man/count_motifs.Rd | 1 - man/dyad.census.Rd | 18 +++++++++ man/dyad_census.Rd | 1 - man/graph.motifs.Rd | 25 ++++++++++++ man/graph.motifs.est.Rd | 37 +++++++++++++++++ man/graph.motifs.no.Rd | 24 +++++++++++ man/motifs.Rd | 1 - man/sample_motifs.Rd | 1 - man/triad.census.Rd | 19 +++++++++ man/triad_census.Rd | 1 - 11 files changed, 198 insertions(+), 19 deletions(-) create mode 100644 man/dyad.census.Rd create mode 100644 man/graph.motifs.Rd create mode 100644 man/graph.motifs.est.Rd create mode 100644 man/graph.motifs.no.Rd create mode 100644 man/triad.census.Rd diff --git a/R/motifs.R b/R/motifs.R index 528549e5332..2495dc790b6 100644 --- a/R/motifs.R +++ b/R/motifs.R @@ -1,4 +1,79 @@ +#' Triad census, subgraphs with three vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `triad.census()` was renamed to `triad_census()` to create a more +#' consistent API. +#' @inheritParams triad_census +#' @keywords internal +#' @export +triad.census <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "triad.census()", "triad_census()") + triad_census(graph = graph) +} # nocov end + +#' Graph motifs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.motifs.no()` was renamed to `count_motifs()` to create a more +#' consistent API. +#' @inheritParams count_motifs +#' @keywords internal +#' @export +graph.motifs.no <- function(graph , size = 3 , cut.prob = rep(0,size)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.motifs.no()", "count_motifs()") + count_motifs(graph = graph, size = size, cut.prob = cut.prob) +} # nocov end + +#' Graph motifs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.motifs.est()` was renamed to `sample_motifs()` to create a more +#' consistent API. +#' @inheritParams sample_motifs +#' @keywords internal +#' @export +graph.motifs.est <- function(graph , size = 3 , cut.prob = rep(0,size) , sample.size = vcount(graph)/10 , sample = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.motifs.est()", "sample_motifs()") + sample_motifs(graph = graph, size = size, cut.prob = cut.prob, sample.size = sample.size, sample = sample) +} # nocov end + +#' Graph motifs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.motifs()` was renamed to `motifs()` to create a more +#' consistent API. +#' @inheritParams motifs +#' @keywords internal +#' @export +graph.motifs <- function(graph , size = 3 , cut.prob = rep(0,size)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.motifs()", "motifs()") + motifs(graph = graph, size = size, cut.prob = cut.prob) +} # nocov end + +#' Dyad census of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `dyad.census()` was renamed to `dyad_census()` to create a more +#' consistent API. +#' @inheritParams dyad_census +#' @keywords internal +#' @export +dyad.census <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "dyad.census()", "dyad_census()") + dyad_census(graph = graph) +} # nocov end + # IGraph R package # Copyright (C) 2006-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -30,7 +105,6 @@ #' the motifs is defined by their isomorphism class, see #' [isomorphism_class()]. #' -#' @aliases graph.motifs #' @param graph Graph object, the input graph. #' @param size The size of the motif, currently sizes 3 and 4 are supported in #' directed graphs and sizes 3-6 in undirected graphs. @@ -78,7 +152,6 @@ motifs <- function(graph, size = 3, cut.prob = rep(0, size)) { #' `count_motifs()` calculates the total number of motifs of a given #' size in graph. #' -#' @aliases graph.motifs.no #' @param graph Graph object, the input graph. #' @param size The size of the motif. #' @param cut.prob Numeric vector giving the probabilities that the search @@ -120,7 +193,6 @@ count_motifs <- function(graph, size = 3, cut.prob = rep(0, size)) { #' `sample_motifs()` estimates the total number of motifs of a given #' size in a graph based on a sample. #' -#' @aliases graph.motifs.est #' @param graph Graph object, the input graph. #' @param size The size of the motif, currently size 3 and 4 are supported #' in directed graphs and sizes 3-6 in undirected graphs. @@ -169,7 +241,6 @@ sample_motifs <- function(graph, size = 3, cut.prob = rep(0, size), #' non-existent. #' #' -#' @aliases dyad.census #' @param graph The input graph. A warning is given if it is not directed. #' @return A named numeric vector with three elements: \item{mut}{The number of #' pairs with mutual connections.} \item{asym}{The number of pairs with @@ -220,7 +291,6 @@ dyad_census <- function(graph) { #' This functions uses the RANDESU motif finder algorithm to find and count the #' subgraphs, see [motifs()]. #' -#' @aliases triad.census #' @param graph The input graph, it should be directed. An undirected graph #' results a warning, and undefined results. #' @return A numeric vector, the subgraph counts, in the order given in the @@ -241,12 +311,3 @@ dyad_census <- function(graph) { #' @export triad_census <- triad_census_impl #' @export dyad.census -deprecated("dyad.census", dyad_census) -#' @export graph.motifs -deprecated("graph.motifs", motifs) -#' @export graph.motifs.est -deprecated("graph.motifs.est", sample_motifs) -#' @export graph.motifs.no -deprecated("graph.motifs.no", count_motifs) -#' @export triad.census -deprecated("triad.census", triad_census) diff --git a/man/count_motifs.Rd b/man/count_motifs.Rd index 8a14b774ad3..3952cb1ccbe 100644 --- a/man/count_motifs.Rd +++ b/man/count_motifs.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/motifs.R \name{count_motifs} \alias{count_motifs} -\alias{graph.motifs.no} \title{Graph motifs} \usage{ count_motifs(graph, size = 3, cut.prob = rep(0, size)) diff --git a/man/dyad.census.Rd b/man/dyad.census.Rd new file mode 100644 index 00000000000..ef0b7eb4b4a --- /dev/null +++ b/man/dyad.census.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/motifs.R +\name{dyad.census} +\alias{dyad.census} +\title{Dyad census of a graph} +\usage{ +dyad.census(graph) +} +\arguments{ +\item{graph}{The input graph. A warning is given if it is not directed.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{dyad.census()} was renamed to \code{dyad_census()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/dyad_census.Rd b/man/dyad_census.Rd index a3f261eb783..9cff6b3ee83 100644 --- a/man/dyad_census.Rd +++ b/man/dyad_census.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/motifs.R \name{dyad_census} \alias{dyad_census} -\alias{dyad.census} \title{Dyad census of a graph} \usage{ dyad_census(graph) diff --git a/man/graph.motifs.Rd b/man/graph.motifs.Rd new file mode 100644 index 00000000000..00ff37371b1 --- /dev/null +++ b/man/graph.motifs.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/motifs.R +\name{graph.motifs} +\alias{graph.motifs} +\title{Graph motifs} +\usage{ +graph.motifs(graph, size = 3, cut.prob = rep(0, size)) +} +\arguments{ +\item{graph}{Graph object, the input graph.} + +\item{size}{The size of the motif, currently sizes 3 and 4 are supported in +directed graphs and sizes 3-6 in undirected graphs.} + +\item{cut.prob}{Numeric vector giving the probabilities that the search +graph is cut at a certain level. Its length should be the same as the size +of the motif (the \code{size} argument). By default no cuts are made.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.motifs()} was renamed to \code{motifs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.motifs.est.Rd b/man/graph.motifs.est.Rd new file mode 100644 index 00000000000..82dce6287d4 --- /dev/null +++ b/man/graph.motifs.est.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/motifs.R +\name{graph.motifs.est} +\alias{graph.motifs.est} +\title{Graph motifs} +\usage{ +graph.motifs.est( + graph, + size = 3, + cut.prob = rep(0, size), + sample.size = vcount(graph)/10, + sample = NULL +) +} +\arguments{ +\item{graph}{Graph object, the input graph.} + +\item{size}{The size of the motif, currently size 3 and 4 are supported +in directed graphs and sizes 3-6 in undirected graphs.} + +\item{cut.prob}{Numeric vector giving the probabilities that the search +graph is cut at a certain level. Its length should be the same as the size +of the motif (the \code{size} argument). By default no cuts are made.} + +\item{sample.size}{The number of vertices to use as a starting point for +finding motifs. Only used if the \code{sample} argument is \code{NULL}.} + +\item{sample}{If not \code{NULL} then it specifies the vertices to use as a +starting point for finding motifs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.motifs.est()} was renamed to \code{sample_motifs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.motifs.no.Rd b/man/graph.motifs.no.Rd new file mode 100644 index 00000000000..238fedc1b44 --- /dev/null +++ b/man/graph.motifs.no.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/motifs.R +\name{graph.motifs.no} +\alias{graph.motifs.no} +\title{Graph motifs} +\usage{ +graph.motifs.no(graph, size = 3, cut.prob = rep(0, size)) +} +\arguments{ +\item{graph}{Graph object, the input graph.} + +\item{size}{The size of the motif.} + +\item{cut.prob}{Numeric vector giving the probabilities that the search +graph is cut at a certain level. Its length should be the same as the size +of the motif (the \code{size} argument). By default no cuts are made.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.motifs.no()} was renamed to \code{count_motifs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/motifs.Rd b/man/motifs.Rd index 7366d2ae96b..0ad6157b7ed 100644 --- a/man/motifs.Rd +++ b/man/motifs.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/motifs.R \name{motifs} \alias{motifs} -\alias{graph.motifs} \title{Graph motifs} \usage{ motifs(graph, size = 3, cut.prob = rep(0, size)) diff --git a/man/sample_motifs.Rd b/man/sample_motifs.Rd index 3b1916d9e22..3d9eac4f8e1 100644 --- a/man/sample_motifs.Rd +++ b/man/sample_motifs.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/motifs.R \name{sample_motifs} \alias{sample_motifs} -\alias{graph.motifs.est} \title{Graph motifs} \usage{ sample_motifs( diff --git a/man/triad.census.Rd b/man/triad.census.Rd new file mode 100644 index 00000000000..81f27edcd41 --- /dev/null +++ b/man/triad.census.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/motifs.R +\name{triad.census} +\alias{triad.census} +\title{Triad census, subgraphs with three vertices} +\usage{ +triad.census(graph) +} +\arguments{ +\item{graph}{The input graph, it should be directed. An undirected graph +results a warning, and undefined results.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{triad.census()} was renamed to \code{triad_census()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/triad_census.Rd b/man/triad_census.Rd index 1c06b3a361c..04de4ec2e2c 100644 --- a/man/triad_census.Rd +++ b/man/triad_census.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/motifs.R \name{triad_census} \alias{triad_census} -\alias{triad.census} \title{Triad census, subgraphs with three vertices} \usage{ triad_census(graph) From 016ffa34e875b462b630caf5bd7b247d158f8325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:07:57 +0100 Subject: [PATCH 34/48] refactor!: change R/operators.R --- R/operators.R | 112 ++++++++++++++++++++++++++++++------ man/complementer.Rd | 1 - man/compose.Rd | 1 - man/difference.igraph.Rd | 1 - man/disjoint_union.Rd | 1 - man/graph.complementer.Rd | 20 +++++++ man/graph.compose.Rd | 26 +++++++++ man/graph.difference.Rd | 19 ++++++ man/graph.disjoint.union.Rd | 18 ++++++ man/graph.intersection.Rd | 19 ++++++ man/graph.union.Rd | 24 ++++++++ man/intersection.igraph.Rd | 1 - man/union.igraph.Rd | 1 - 13 files changed, 221 insertions(+), 23 deletions(-) create mode 100644 man/graph.complementer.Rd create mode 100644 man/graph.compose.Rd create mode 100644 man/graph.difference.Rd create mode 100644 man/graph.disjoint.union.Rd create mode 100644 man/graph.intersection.Rd create mode 100644 man/graph.union.Rd diff --git a/R/operators.R b/R/operators.R index 57d358fda1f..6f4bd98d67e 100644 --- a/R/operators.R +++ b/R/operators.R @@ -1,3 +1,93 @@ + +#' Intersection of two or more sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.intersection()` was renamed to `intersection()` to create a more +#' consistent API. +#' @inheritParams intersection +#' @keywords internal +#' @export +graph.intersection <- function(...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.intersection()", "intersection()") + intersection(...) +} # nocov end + +#' Union of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.union()` was renamed to `union.igraph()` to create a more +#' consistent API. +#' @inheritParams union.igraph +#' @keywords internal +#' @export +graph.union <- function(... , byname = "auto") { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.union()", "union.igraph()") + union.igraph(byname = byname, ...) +} # nocov end + +#' Difference of two sets +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.difference()` was renamed to `difference()` to create a more +#' consistent API. +#' @inheritParams difference +#' @keywords internal +#' @export +graph.difference <- function(...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.difference()", "difference()") + difference(...) +} # nocov end + +#' Disjoint union of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.disjoint.union()` was renamed to `disjoint_union()` to create a more +#' consistent API. +#' @inheritParams disjoint_union +#' @keywords internal +#' @export +graph.disjoint.union <- function(...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.disjoint.union()", "disjoint_union()") + disjoint_union(...) +} # nocov end + +#' Compose two graphs as binary relations +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.compose()` was renamed to `compose()` to create a more +#' consistent API. +#' @inheritParams compose +#' @keywords internal +#' @export +graph.compose <- function(g1 , g2 , byname = "auto") { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.compose()", "compose()") + compose(g1 = g1, g2 = g2, byname = byname) +} # nocov end + +#' Complementer of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.complementer()` was renamed to `complementer()` to create a more +#' consistent API. +#' @inheritParams complementer +#' @keywords internal +#' @export +graph.complementer <- function(graph , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.complementer()", "complementer()") + complementer(graph = graph, loops = loops) +} # nocov end # IGraph R package # Copyright (C) 2006-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -96,7 +186,7 @@ rename.attr.if.needed <- function(type, graphs, newsize = NULL, maps = NULL, #' An error is generated if some input graphs are directed and others are #' undirected. #' -#' @aliases graph.disjoint.union %du% +#' @aliases %du% #' @param \dots Graph objects or lists of graph objects. #' @param x,y Graph objects. #' @return A new graph object. @@ -332,7 +422,7 @@ union.default <- function(...) { #' An error is generated if some input graphs are directed and others are #' undirected. #' -#' @aliases graph.union %u% +#' @aliases %u% #' @param \dots Graph objects or lists of graph objects. #' @param byname A logical scalar, or the character scalar `auto`. Whether #' to perform the operation based on symbolic vertex names. If it is @@ -411,7 +501,7 @@ intersection <- function(...) { #' An error is generated if some input graphs are directed and others are #' undirected. #' -#' @aliases graph.intersection %s% +#' @aliases %s% #' @param \dots Graph objects or lists of graph objects. #' @param byname A logical scalar, or the character scalar `auto`. Whether #' to perform the operation based on symbolic vertex names. If it is @@ -487,7 +577,7 @@ difference <- function(...) { #' Note that `big` and `small` must both be directed or both be #' undirected, otherwise an error message is given. #' -#' @aliases graph.difference %m% +#' @aliases %m% #' @param big The left hand side argument of the minus operator. A directed or #' undirected graph. #' @param small The right hand side argument of the minus operator. A directed @@ -577,7 +667,6 @@ difference.igraph <- function(big, small, byname = "auto", ...) { #' `complementer()` keeps graph and vertex attriubutes, edge #' attributes are lost. #' -#' @aliases graph.complementer #' @param graph The input graph, can be directed or undirected. #' @param loops Logical constant, whether to generate loop edges. #' @return A new graph object. @@ -647,7 +736,7 @@ complementer <- function(graph, loops = FALSE) { #' g1 and g2, respectively, then (a,a) is included in the result. See #' [simplify()] if you want to get rid of the self-loops. #' -#' @aliases graph.compose %c% +#' @aliases %c% #' @param g1 The first input graph. #' @param g2 The second input graph. #' @param byname A logical scalar, or the character scalar `auto`. Whether @@ -1195,14 +1284,3 @@ reverse_edges <- reverse_edges_impl #' @export t.igraph <- function(x) reverse_edges(x) #' @export graph.complementer -deprecated("graph.complementer", complementer) -#' @export graph.compose -deprecated("graph.compose", compose) -#' @export graph.disjoint.union -deprecated("graph.disjoint.union", disjoint_union) -#' @export graph.difference -deprecated("graph.difference", difference) -#' @export graph.union -deprecated("graph.union", union.igraph) -#' @export graph.intersection -deprecated("graph.intersection", intersection) diff --git a/man/complementer.Rd b/man/complementer.Rd index 2d28bf6c9d0..e96d72b5325 100644 --- a/man/complementer.Rd +++ b/man/complementer.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{complementer} \alias{complementer} -\alias{graph.complementer} \title{Complementer of a graph} \usage{ complementer(graph, loops = FALSE) diff --git a/man/compose.Rd b/man/compose.Rd index 5ee0634c6c2..3e84f901aed 100644 --- a/man/compose.Rd +++ b/man/compose.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{compose} \alias{compose} -\alias{graph.compose} \alias{\%c\%} \title{Compose two graphs as binary relations} \usage{ diff --git a/man/difference.igraph.Rd b/man/difference.igraph.Rd index 34a5e3e2f2b..73a1ce36558 100644 --- a/man/difference.igraph.Rd +++ b/man/difference.igraph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{difference.igraph} \alias{difference.igraph} -\alias{graph.difference} \alias{\%m\%} \title{Difference of graphs} \usage{ diff --git a/man/disjoint_union.Rd b/man/disjoint_union.Rd index 73c1c03fc86..afe0e421300 100644 --- a/man/disjoint_union.Rd +++ b/man/disjoint_union.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{disjoint_union} \alias{disjoint_union} -\alias{graph.disjoint.union} \alias{\%du\%} \title{Disjoint union of graphs} \usage{ diff --git a/man/graph.complementer.Rd b/man/graph.complementer.Rd new file mode 100644 index 00000000000..fb80a6cb9be --- /dev/null +++ b/man/graph.complementer.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.complementer} +\alias{graph.complementer} +\title{Complementer of a graph} +\usage{ +graph.complementer(graph, loops = FALSE) +} +\arguments{ +\item{graph}{The input graph, can be directed or undirected.} + +\item{loops}{Logical constant, whether to generate loop edges.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.complementer()} was renamed to \code{complementer()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.compose.Rd b/man/graph.compose.Rd new file mode 100644 index 00000000000..45ffa7b8fee --- /dev/null +++ b/man/graph.compose.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.compose} +\alias{graph.compose} +\title{Compose two graphs as binary relations} +\usage{ +graph.compose(g1, g2, byname = "auto") +} +\arguments{ +\item{g1}{The first input graph.} + +\item{g2}{The second input graph.} + +\item{byname}{A logical scalar, or the character scalar \code{auto}. Whether +to perform the operation based on symbolic vertex names. If it is +\code{auto}, that means \code{TRUE} if both graphs are named and +\code{FALSE} otherwise. A warning is generated if \code{auto} and one graph, +but not both graphs are named.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.compose()} was renamed to \code{compose()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.difference.Rd b/man/graph.difference.Rd new file mode 100644 index 00000000000..81537597a05 --- /dev/null +++ b/man/graph.difference.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.difference} +\alias{graph.difference} +\title{Difference of two sets} +\usage{ +graph.difference(...) +} +\arguments{ +\item{...}{Arguments, their number and interpretation depends on +the function that implements \code{difference()}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.difference()} was renamed to \code{difference()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.disjoint.union.Rd b/man/graph.disjoint.union.Rd new file mode 100644 index 00000000000..c6b1c7d4272 --- /dev/null +++ b/man/graph.disjoint.union.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.disjoint.union} +\alias{graph.disjoint.union} +\title{Disjoint union of graphs} +\usage{ +graph.disjoint.union(...) +} +\arguments{ +\item{...}{Graph objects or lists of graph objects.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.disjoint.union()} was renamed to \code{disjoint_union()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.intersection.Rd b/man/graph.intersection.Rd new file mode 100644 index 00000000000..6f937f6a664 --- /dev/null +++ b/man/graph.intersection.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.intersection} +\alias{graph.intersection} +\title{Intersection of two or more sets} +\usage{ +graph.intersection(...) +} +\arguments{ +\item{...}{Arguments, their number and interpretation depends on +the function that implements \code{intersection()}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.intersection()} was renamed to \code{intersection()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.union.Rd b/man/graph.union.Rd new file mode 100644 index 00000000000..48d65bebb39 --- /dev/null +++ b/man/graph.union.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/operators.R +\name{graph.union} +\alias{graph.union} +\title{Union of graphs} +\usage{ +graph.union(..., byname = "auto") +} +\arguments{ +\item{...}{Graph objects or lists of graph objects.} + +\item{byname}{A logical scalar, or the character scalar \code{auto}. Whether +to perform the operation based on symbolic vertex names. If it is +\code{auto}, that means \code{TRUE} if all graphs are named and \code{FALSE} +otherwise. A warning is generated if \code{auto} and some (but not all) +graphs are named.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.union()} was renamed to \code{union.igraph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/intersection.igraph.Rd b/man/intersection.igraph.Rd index dc9c688975f..a0b861b516f 100644 --- a/man/intersection.igraph.Rd +++ b/man/intersection.igraph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{intersection.igraph} \alias{intersection.igraph} -\alias{graph.intersection} \alias{\%s\%} \title{Intersection of graphs} \usage{ diff --git a/man/union.igraph.Rd b/man/union.igraph.Rd index 60fb4d413d4..f5d87f16f36 100644 --- a/man/union.igraph.Rd +++ b/man/union.igraph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/operators.R \name{union.igraph} \alias{union.igraph} -\alias{graph.union} \alias{\%u\%} \title{Union of graphs} \usage{ From 3ede6bd4917ba5848dd9dbdfa468cedc9f633cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:08:36 +0100 Subject: [PATCH 35/48] refactor!: change R/other.R --- R/other.R | 53 +++++++++++++++++++++++++++++++++++++------- man/convex.hull.Rd | 18 +++++++++++++++ man/convex_hull.Rd | 1 - man/igraph.sample.Rd | 22 ++++++++++++++++++ man/running.mean.Rd | 21 ++++++++++++++++++ man/running_mean.Rd | 1 - man/sample_seq.Rd | 1 - 7 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 man/convex.hull.Rd create mode 100644 man/igraph.sample.Rd create mode 100644 man/running.mean.Rd diff --git a/R/other.R b/R/other.R index 4c6619f232f..2e2ac7840cd 100644 --- a/R/other.R +++ b/R/other.R @@ -1,3 +1,48 @@ + +#' Running mean of a time series +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `running.mean()` was renamed to `running_mean()` to create a more +#' consistent API. +#' @inheritParams running_mean +#' @keywords internal +#' @export +running.mean <- function(v , binwidth) { # nocov start + lifecycle::deprecate_soft("1.6.0", "running.mean()", "running_mean()") + running_mean(v = v, binwidth = binwidth) +} # nocov end + +#' Sampling a random integer sequence +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.sample()` was renamed to `sample_seq()` to create a more +#' consistent API. +#' @inheritParams sample_seq +#' @keywords internal +#' @export +igraph.sample <- function(low , high , length) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.sample()", "sample_seq()") + sample_seq(low = low, high = high, length = length) +} # nocov end + +#' Convex hull of a set of vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `convex.hull()` was renamed to `convex_hull()` to create a more +#' consistent API. +#' @inheritParams convex_hull +#' @keywords internal +#' @export +convex.hull <- function(data) { # nocov start + lifecycle::deprecate_soft("1.6.0", "convex.hull()", "convex_hull()") + convex_hull(data = data) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -31,7 +76,6 @@ #' the first `binwidth` elements of `v`, the second element of #' `w` is the average of elements `2:(binwidth+1)`, etc. #' -#' @aliases running.mean #' @param v The numeric vector. #' @param binwidth Numeric constant, the size of the bin, should be meaningful, #' i.e. smaller than the length of `v`. @@ -66,7 +110,6 @@ running_mean <- function(v, binwidth) { #' `high-low` is big. It is much faster (but of course less general) than #' the builtin `sample` function of R. #' -#' @aliases igraph.sample #' @param low The lower limit of the interval (inclusive). #' @param high The higher limit of the interval (inclusive). #' @param length The length of the sample. @@ -161,7 +204,6 @@ igraph.i.spMatrix <- function(M) { #' has the smallest area. #' #' -#' @aliases convex.hull #' @param data The data points, a numeric matrix with two columns. #' @return A named list with components: \item{resverts}{The indices of the #' input vertices that constritute the convex hull.} \item{rescoords}{The @@ -180,8 +222,3 @@ igraph.i.spMatrix <- function(M) { #' @export convex_hull <- convex_hull_impl #' @export convex.hull -deprecated("convex.hull", convex_hull) -#' @export igraph.sample -deprecated("igraph.sample", sample_seq) -#' @export running.mean -deprecated("running.mean", running_mean) diff --git a/man/convex.hull.Rd b/man/convex.hull.Rd new file mode 100644 index 00000000000..ebe8dd49ac7 --- /dev/null +++ b/man/convex.hull.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/other.R +\name{convex.hull} +\alias{convex.hull} +\title{Convex hull of a set of vertices} +\usage{ +convex.hull(data) +} +\arguments{ +\item{data}{The data points, a numeric matrix with two columns.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{convex.hull()} was renamed to \code{convex_hull()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/convex_hull.Rd b/man/convex_hull.Rd index f6e5f8bb8a3..8955875ae4d 100644 --- a/man/convex_hull.Rd +++ b/man/convex_hull.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/other.R \name{convex_hull} \alias{convex_hull} -\alias{convex.hull} \title{Convex hull of a set of vertices} \usage{ convex_hull(data) diff --git a/man/igraph.sample.Rd b/man/igraph.sample.Rd new file mode 100644 index 00000000000..7b9b6a3ab8e --- /dev/null +++ b/man/igraph.sample.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/other.R +\name{igraph.sample} +\alias{igraph.sample} +\title{Sampling a random integer sequence} +\usage{ +igraph.sample(low, high, length) +} +\arguments{ +\item{low}{The lower limit of the interval (inclusive).} + +\item{high}{The higher limit of the interval (inclusive).} + +\item{length}{The length of the sample.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.sample()} was renamed to \code{sample_seq()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/running.mean.Rd b/man/running.mean.Rd new file mode 100644 index 00000000000..40030a0d38f --- /dev/null +++ b/man/running.mean.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/other.R +\name{running.mean} +\alias{running.mean} +\title{Running mean of a time series} +\usage{ +running.mean(v, binwidth) +} +\arguments{ +\item{v}{The numeric vector.} + +\item{binwidth}{Numeric constant, the size of the bin, should be meaningful, +i.e. smaller than the length of \code{v}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{running.mean()} was renamed to \code{running_mean()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/running_mean.Rd b/man/running_mean.Rd index 8ce0227c334..313d274fbbb 100644 --- a/man/running_mean.Rd +++ b/man/running_mean.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/other.R \name{running_mean} \alias{running_mean} -\alias{running.mean} \title{Running mean of a time series} \usage{ running_mean(v, binwidth) diff --git a/man/sample_seq.Rd b/man/sample_seq.Rd index 85cfee64bc6..ba6e5fc58d5 100644 --- a/man/sample_seq.Rd +++ b/man/sample_seq.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/other.R \name{sample_seq} \alias{sample_seq} -\alias{igraph.sample} \title{Sampling a random integer sequence} \usage{ sample_seq(low, high, length) From 7886832d3a4becdb84bb83706f24d2c4d8f6bb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:09:21 +0100 Subject: [PATCH 36/48] refactor!: change R/par.R --- R/par.R | 35 +++++++++++++++++++++++++++++++---- man/getIgraphOpt.Rd | 22 ++++++++++++++++++++++ man/igraph.options.Rd | 20 ++++++++++++++++++++ man/igraph_options.Rd | 2 -- 4 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 man/getIgraphOpt.Rd create mode 100644 man/igraph.options.Rd diff --git a/R/par.R b/R/par.R index 5704cc350e1..aa2157ecf22 100644 --- a/R/par.R +++ b/R/par.R @@ -1,4 +1,34 @@ +#' Parameters for the igraph package +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.options()` was renamed to `igraph_options()` to create a more +#' consistent API. +#' @inheritParams igraph_options +#' @keywords internal +#' @export +igraph.options <- function(...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.options()", "igraph_options()") + igraph_options(...) +} # nocov end + +#' Parameters for the igraph package +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `getIgraphOpt()` was renamed to `igraph_opt()` to create a more +#' consistent API. +#' @inheritParams igraph_opt +#' @keywords internal +#' @export +getIgraphOpt <- function(x , default = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "getIgraphOpt()", "igraph_opt()") + igraph_opt(x = x, default = default) +} # nocov end + # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -126,7 +156,7 @@ igraph.pars.callbacks <- list("verbose" = igraph.pars.set.verbose) #' [attribute.combination()] for details on this.} #' } #' -#' @aliases igraph.options igraph_options getIgraphOpt igraph_opt +#' @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. @@ -248,6 +278,3 @@ with_igraph_opt <- function(options, code) { force(code) } #' @export getIgraphOpt -deprecated("getIgraphOpt", igraph_opt) -#' @export igraph.options -deprecated("igraph.options", igraph_options) diff --git a/man/getIgraphOpt.Rd b/man/getIgraphOpt.Rd new file mode 100644 index 00000000000..ca7b7a6a292 --- /dev/null +++ b/man/getIgraphOpt.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/par.R +\name{getIgraphOpt} +\alias{getIgraphOpt} +\title{Parameters for the igraph package} +\usage{ +getIgraphOpt(x, default = NULL) +} +\arguments{ +\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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{getIgraphOpt()} was renamed to \code{igraph_opt()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph.options.Rd b/man/igraph.options.Rd new file mode 100644 index 00000000000..2dcb1ded5a6 --- /dev/null +++ b/man/igraph.options.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/par.R +\name{igraph.options} +\alias{igraph.options} +\title{Parameters for the igraph package} +\usage{ +igraph.options(...) +} +\arguments{ +\item{...}{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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.options()} was renamed to \code{igraph_options()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph_options.Rd b/man/igraph_options.Rd index 9c8797979a8..4c75852c87d 100644 --- a/man/igraph_options.Rd +++ b/man/igraph_options.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/par.R \name{igraph_options} \alias{igraph_options} -\alias{igraph.options} -\alias{getIgraphOpt} \alias{igraph_opt} \title{Parameters for the igraph package} \usage{ From 1a30b162955d84457337d4421670fbe7628d9347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:10:04 +0100 Subject: [PATCH 37/48] refactor!: change R/paths.R --- R/paths.R | 53 +++++++++++++++++++++++++++---- man/is.dag.Rd | 19 +++++++++++ man/is_dag.Rd | 1 - man/max_cardinality.Rd | 1 - man/maximum.cardinality.search.Rd | 19 +++++++++++ man/path.length.hist.Rd | 21 ++++++++++++ 6 files changed, 105 insertions(+), 9 deletions(-) create mode 100644 man/is.dag.Rd create mode 100644 man/maximum.cardinality.search.Rd create mode 100644 man/path.length.hist.Rd diff --git a/R/paths.R b/R/paths.R index 7d0b6cc38de..5a90c57ac42 100644 --- a/R/paths.R +++ b/R/paths.R @@ -1,3 +1,48 @@ + +#' Shortest (directed or undirected) paths between vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `path.length.hist()` was renamed to `distance_table()` to create a more +#' consistent API. +#' @inheritParams distance_table +#' @keywords internal +#' @export +path.length.hist <- function(graph , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "path.length.hist()", "distance_table()") + distance_table(graph = graph, directed = directed) +} # nocov end + +#' Maximum cardinality search +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maximum.cardinality.search()` was renamed to `max_cardinality()` to create a more +#' consistent API. +#' @inheritParams max_cardinality +#' @keywords internal +#' @export +maximum.cardinality.search <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maximum.cardinality.search()", "max_cardinality()") + max_cardinality(graph = graph) +} # nocov end + +#' Directed acyclic graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.dag()` was renamed to `is_dag()` to create a more +#' consistent API. +#' @inheritParams is_dag +#' @keywords internal +#' @export +is.dag <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.dag()", "is_dag()") + is_dag(graph = graph) +} # nocov end ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -93,7 +138,6 @@ all_simple_paths <- function(graph, from, to = V(graph), #' `is_dag()` checks whether there is a directed cycle in the graph. If not, #' the graph is a DAG. #' -#' @aliases is.dag #' @param graph The input graph. It may be undirected, in which case #' `FALSE` is reported. #' @return A logical vector of length one. @@ -150,7 +194,7 @@ is_acyclic <- function(graph) { #' The algorithm provides a simple basis for deciding whether a graph is #' chordal, see References below, and also [is_chordal()]. #' -#' @aliases maximum.cardinality.search max_cardinality +#' @aliases max_cardinality #' @param graph The input graph. It may be directed, but edge directions are #' ignored, as the algorithm is defined for undirected graphs. #' @return A list with two components: \item{alpha}{Numeric vector. The @@ -263,8 +307,3 @@ radius <- radius_impl #' @export distance_table <- path_length_hist_impl #' @export is.dag -deprecated("is.dag", is_dag) -#' @export maximum.cardinality.search -deprecated("maximum.cardinality.search", max_cardinality) -#' @export path.length.hist -deprecated("path.length.hist", distance_table) diff --git a/man/is.dag.Rd b/man/is.dag.Rd new file mode 100644 index 00000000000..7aa7333df95 --- /dev/null +++ b/man/is.dag.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/paths.R +\name{is.dag} +\alias{is.dag} +\title{Directed acyclic graphs} +\usage{ +is.dag(graph) +} +\arguments{ +\item{graph}{The input graph. It may be undirected, in which case +\code{FALSE} is reported.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.dag()} was renamed to \code{is_dag()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is_dag.Rd b/man/is_dag.Rd index d64ec94edc9..7504e4ae01c 100644 --- a/man/is_dag.Rd +++ b/man/is_dag.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/paths.R \name{is_dag} \alias{is_dag} -\alias{is.dag} \title{Directed acyclic graphs} \usage{ is_dag(graph) diff --git a/man/max_cardinality.Rd b/man/max_cardinality.Rd index 970e29c6068..2dccfe4fe72 100644 --- a/man/max_cardinality.Rd +++ b/man/max_cardinality.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/paths.R \name{max_cardinality} \alias{max_cardinality} -\alias{maximum.cardinality.search} \title{Maximum cardinality search} \usage{ max_cardinality(graph) diff --git a/man/maximum.cardinality.search.Rd b/man/maximum.cardinality.search.Rd new file mode 100644 index 00000000000..61824a991fd --- /dev/null +++ b/man/maximum.cardinality.search.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/paths.R +\name{maximum.cardinality.search} +\alias{maximum.cardinality.search} +\title{Maximum cardinality search} +\usage{ +maximum.cardinality.search(graph) +} +\arguments{ +\item{graph}{The input graph. It may be directed, but edge directions are +ignored, as the algorithm is defined for undirected graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maximum.cardinality.search()} was renamed to \code{max_cardinality()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/path.length.hist.Rd b/man/path.length.hist.Rd new file mode 100644 index 00000000000..96ecac0782b --- /dev/null +++ b/man/path.length.hist.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/paths.R +\name{path.length.hist} +\alias{path.length.hist} +\title{Shortest (directed or undirected) paths between vertices} +\usage{ +path.length.hist(graph, directed = TRUE) +} +\arguments{ +\item{graph}{The graph to work on.} + +\item{directed}{Whether to consider directed paths in directed graphs, +this argument is ignored for undirected graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{path.length.hist()} was renamed to \code{distance_table()} to create a more +consistent API. +} +\keyword{internal} From 461c4f1be1a1b36e8fa6e245880e2b7a85ee6f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:10:41 +0100 Subject: [PATCH 38/48] refactor!: change R/plot.common.R --- R/plot.common.R | 17 +++++++++++++++-- man/autocurve.edges.Rd | 21 +++++++++++++++++++++ man/curve_multiple.Rd | 1 - 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 man/autocurve.edges.Rd diff --git a/R/plot.common.R b/R/plot.common.R index b5df0280b36..0d3930aa697 100644 --- a/R/plot.common.R +++ b/R/plot.common.R @@ -1,3 +1,18 @@ + +#' Optimal edge curvature when plotting graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `autocurve.edges()` was renamed to `curve_multiple()` to create a more +#' consistent API. +#' @inheritParams curve_multiple +#' @keywords internal +#' @export +autocurve.edges <- function(graph , start = 0.5) { # nocov start + lifecycle::deprecate_soft("1.6.0", "autocurve.edges()", "curve_multiple()") + curve_multiple(graph = graph, start = start) +} # nocov end # IGraph R package # Copyright (C) 2003-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -182,7 +197,6 @@ i.postprocess.layout <- function(maybe_layout) { #' `curve_multiple()` calculates the optimal `edge.curved` vector for #' plotting a graph with multiple edges, so that all edges are visible. #' -#' @aliases autocurve.edges #' @param graph The input graph. #' @param start The curvature at the two extreme edges. All edges will have a #' curvature between `-start` and `start`, spaced equally. @@ -973,4 +987,3 @@ i.default.values[["vertex"]] <- i.vertex.default i.default.values[["edge"]] <- i.edge.default i.default.values[["plot"]] <- i.plot.default #' @export autocurve.edges -deprecated("autocurve.edges", curve_multiple) diff --git a/man/autocurve.edges.Rd b/man/autocurve.edges.Rd new file mode 100644 index 00000000000..08e3e3c5bc7 --- /dev/null +++ b/man/autocurve.edges.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.common.R +\name{autocurve.edges} +\alias{autocurve.edges} +\title{Optimal edge curvature when plotting graphs} +\usage{ +autocurve.edges(graph, start = 0.5) +} +\arguments{ +\item{graph}{The input graph.} + +\item{start}{The curvature at the two extreme edges. All edges will have a +curvature between \code{-start} and \code{start}, spaced equally.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{autocurve.edges()} was renamed to \code{curve_multiple()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/curve_multiple.Rd b/man/curve_multiple.Rd index 60fcace19b5..39bb02c9c8f 100644 --- a/man/curve_multiple.Rd +++ b/man/curve_multiple.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/plot.common.R \name{curve_multiple} \alias{curve_multiple} -\alias{autocurve.edges} \title{Optimal edge curvature when plotting graphs} \usage{ curve_multiple(graph, start = 0.5) From 114f38259a5bb51da83929f1194f4db14cbbf559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:11:18 +0100 Subject: [PATCH 39/48] refactor!: change R/plot.shapes.R --- R/plot.shapes.R | 70 +++++++++++++++++++++++++++++++++----- man/add.vertex.shape.Rd | 37 ++++++++++++++++++++ man/igraph.shape.noclip.Rd | 15 ++++++++ man/igraph.shape.noplot.Rd | 15 ++++++++ man/shapes.Rd | 4 --- man/vertex.shapes.Rd | 20 +++++++++++ 6 files changed, 148 insertions(+), 13 deletions(-) create mode 100644 man/add.vertex.shape.Rd create mode 100644 man/igraph.shape.noclip.Rd create mode 100644 man/igraph.shape.noplot.Rd create mode 100644 man/vertex.shapes.Rd diff --git a/R/plot.shapes.R b/R/plot.shapes.R index 1ef92b38e73..922c11e7722 100644 --- a/R/plot.shapes.R +++ b/R/plot.shapes.R @@ -1,4 +1,64 @@ +#' Various vertex shapes when plotting igraph graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.shape.noplot()` was renamed to `shape_noplot()` to create a more +#' consistent API. +#' @inheritParams shape_noplot +#' @keywords internal +#' @export +igraph.shape.noplot <- function(coords , v = NULL , params) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.shape.noplot()", "shape_noplot()") + shape_noplot(coords = coords, v = v, params = params) +} # nocov end + +#' Various vertex shapes when plotting igraph graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.shape.noclip()` was renamed to `shape_noclip()` to create a more +#' consistent API. +#' @inheritParams shape_noclip +#' @keywords internal +#' @export +igraph.shape.noclip <- function(coords , el , params , end = c("both","from","to")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.shape.noclip()", "shape_noclip()") + shape_noclip(coords = coords, el = el, params = params, end = end) +} # nocov end + +#' Various vertex shapes when plotting igraph graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `vertex.shapes()` was renamed to `shapes()` to create a more +#' consistent API. +#' @inheritParams shapes +#' @keywords internal +#' @export +vertex.shapes <- function(shape = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "vertex.shapes()", "shapes()") + shapes(shape = shape) +} # nocov end + +#' Various vertex shapes when plotting igraph graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `add.vertex.shape()` was renamed to `add_shape()` to create a more +#' consistent API. +#' @inheritParams add_shape +#' @keywords internal +#' @export +add.vertex.shape <- function(shape , clip = shape_noclip , plot = shape_noplot , parameters = list()) { # nocov start + lifecycle::deprecate_soft("1.6.0", "add.vertex.shape()", "add_shape()") + add_shape(shape = shape, clip = clip, plot = plot, parameters = parameters) +} # nocov end + # IGraph R package # Copyright (C) 2003-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -151,8 +211,7 @@ #' `shape_noplot()` is a very simple (and probably not very #' useful) plotting function, that does not plot anything. #' -#' @aliases add.vertex.shape igraph.shape.noclip igraph.shape.noplot -#' vertex.shapes igraph.vertex.shapes +#' @aliases igraph.vertex.shapes #' #' @param shape Character scalar, name of a vertex shape. If it is #' `NULL` for `shapes()`, then the names of all defined @@ -1102,10 +1161,3 @@ mypie <- function(x, y, values, radius, edges = 200, col = NULL, angle = 45, plot = .igraph.shape.raster.plot ) #' @export add.vertex.shape -deprecated("add.vertex.shape", add_shape) -#' @export vertex.shapes -deprecated("vertex.shapes", shapes) -#' @export igraph.shape.noclip -deprecated("igraph.shape.noclip", shape_noclip) -#' @export igraph.shape.noplot -deprecated("igraph.shape.noplot", shape_noplot) diff --git a/man/add.vertex.shape.Rd b/man/add.vertex.shape.Rd new file mode 100644 index 00000000000..b5cc9497e2e --- /dev/null +++ b/man/add.vertex.shape.Rd @@ -0,0 +1,37 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.shapes.R +\name{add.vertex.shape} +\alias{add.vertex.shape} +\title{Various vertex shapes when plotting igraph graphs} +\usage{ +add.vertex.shape( + shape, + clip = shape_noclip, + plot = shape_noplot, + parameters = list() +) +} +\arguments{ +\item{shape}{Character scalar, name of a vertex shape. If it is +\code{NULL} for \code{shapes()}, then the names of all defined +vertex shapes are returned.} + +\item{clip}{An R function object, the clipping function.} + +\item{plot}{An R function object, the plotting function.} + +\item{parameters}{Named list, additional plot/vertex/edge +parameters. The element named define the new parameters, and the +elements themselves define their default values. +Vertex parameters should have a prefix +\sQuote{\code{vertex.}}, edge parameters a prefix +\sQuote{\code{edge.}}. Other general plotting parameters should have +a prefix \sQuote{\code{plot.}}. See Details below.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{add.vertex.shape()} was renamed to \code{add_shape()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph.shape.noclip.Rd b/man/igraph.shape.noclip.Rd new file mode 100644 index 00000000000..56b7a86d522 --- /dev/null +++ b/man/igraph.shape.noclip.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.shapes.R +\name{igraph.shape.noclip} +\alias{igraph.shape.noclip} +\title{Various vertex shapes when plotting igraph graphs} +\usage{ +igraph.shape.noclip(coords, el, params, end = c("both", "from", "to")) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.shape.noclip()} was renamed to \code{shape_noclip()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph.shape.noplot.Rd b/man/igraph.shape.noplot.Rd new file mode 100644 index 00000000000..d824ee3df31 --- /dev/null +++ b/man/igraph.shape.noplot.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.shapes.R +\name{igraph.shape.noplot} +\alias{igraph.shape.noplot} +\title{Various vertex shapes when plotting igraph graphs} +\usage{ +igraph.shape.noplot(coords, v = NULL, params) +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.shape.noplot()} was renamed to \code{shape_noplot()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/shapes.Rd b/man/shapes.Rd index c7bcdd68e4e..22b10927f37 100644 --- a/man/shapes.Rd +++ b/man/shapes.Rd @@ -2,10 +2,6 @@ % Please edit documentation in R/plot.shapes.R \name{shapes} \alias{shapes} -\alias{add.vertex.shape} -\alias{igraph.shape.noclip} -\alias{igraph.shape.noplot} -\alias{vertex.shapes} \alias{igraph.vertex.shapes} \alias{shape_noclip} \alias{shape_noplot} diff --git a/man/vertex.shapes.Rd b/man/vertex.shapes.Rd new file mode 100644 index 00000000000..df20602a963 --- /dev/null +++ b/man/vertex.shapes.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/plot.shapes.R +\name{vertex.shapes} +\alias{vertex.shapes} +\title{Various vertex shapes when plotting igraph graphs} +\usage{ +vertex.shapes(shape = NULL) +} +\arguments{ +\item{shape}{Character scalar, name of a vertex shape. If it is +\code{NULL} for \code{shapes()}, then the names of all defined +vertex shapes are returned.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{vertex.shapes()} was renamed to \code{shapes()} to create a more +consistent API. +} +\keyword{internal} From 4dbc6f45f929a2ebda48022f599ca3fcfbdd6a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:11:57 +0100 Subject: [PATCH 40/48] refactor!: change R/scg.R --- R/scg.R | 17 +++++++++++++++-- man/get.stochastic.Rd | 28 ++++++++++++++++++++++++++++ man/stochastic_matrix.Rd | 1 - 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 man/get.stochastic.Rd diff --git a/R/scg.R b/R/scg.R index c9573f74529..1fc8533d67d 100644 --- a/R/scg.R +++ b/R/scg.R @@ -1,3 +1,18 @@ + +#' Stochastic matrix of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.stochastic()` was renamed to `stochastic_matrix()` to create a more +#' consistent API. +#' @inheritParams stochastic_matrix +#' @keywords internal +#' @export +get.stochastic <- function(graph , column.wise = FALSE , sparse = igraph_opt("sparsematrices")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.stochastic()", "stochastic_matrix()") + stochastic_matrix(graph = graph, column.wise = column.wise, sparse = sparse) +} # nocov end # IGraph R package # Copyright (C) 2010-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -77,7 +92,6 @@ NULL #' where it is assumed that \eqn{D} is non-singular. Column stochastic #' matrices are defined in a symmetric way. #' -#' @aliases get.stochastic #' @param graph The input graph. Must be of class `igraph`. #' @param column.wise If `FALSE`, then the rows of the stochastic matrix #' sum up to one; otherwise it is the columns. @@ -132,4 +146,3 @@ stochastic_matrix <- function(graph, column.wise = FALSE, res } #' @export get.stochastic -deprecated("get.stochastic", stochastic_matrix) diff --git a/man/get.stochastic.Rd b/man/get.stochastic.Rd new file mode 100644 index 00000000000..0c11cea8ec6 --- /dev/null +++ b/man/get.stochastic.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scg.R +\name{get.stochastic} +\alias{get.stochastic} +\title{Stochastic matrix of a graph} +\usage{ +get.stochastic( + graph, + column.wise = FALSE, + sparse = igraph_opt("sparsematrices") +) +} +\arguments{ +\item{graph}{The input graph. Must be of class \code{igraph}.} + +\item{column.wise}{If \code{FALSE}, then the rows of the stochastic matrix +sum up to one; otherwise it is the columns.} + +\item{sparse}{Logical scalar, whether to return a sparse matrix. The +\code{Matrix} package is needed for sparse matrices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.stochastic()} was renamed to \code{stochastic_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/stochastic_matrix.Rd b/man/stochastic_matrix.Rd index d74452b064a..678ff019307 100644 --- a/man/stochastic_matrix.Rd +++ b/man/stochastic_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/scg.R \name{stochastic_matrix} \alias{stochastic_matrix} -\alias{get.stochastic} \title{Stochastic matrix of a graph} \usage{ stochastic_matrix( From af09787e41f1ce959a096492b55e73368e3b5253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:12:33 +0100 Subject: [PATCH 41/48] refactor!: change R/simple.R --- R/simple.R | 18 ++++++++++++++++-- man/is.simple.Rd | 18 ++++++++++++++++++ man/simplify.Rd | 1 - 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 man/is.simple.Rd diff --git a/R/simple.R b/R/simple.R index 1ab4dd3ad90..cba02700e51 100644 --- a/R/simple.R +++ b/R/simple.R @@ -1,4 +1,19 @@ +#' Simple graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.simple()` was renamed to `is_simple()` to create a more +#' consistent API. +#' @inheritParams is_simple +#' @keywords internal +#' @export +is.simple <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.simple()", "is_simple()") + is_simple(graph = graph) +} # nocov end + ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -47,7 +62,7 @@ #' the original graph are discarded as the primary purpose of this function is #' to facilitate the usage of multigraphs with the VF2 algorithm. #' -#' @aliases simplify is.simple +#' @aliases simplify #' @param graph The graph to work on. #' @param remove.loops Logical, whether the loop edges are to be removed. #' @param remove.multiple Logical, whether the multiple edges are to be @@ -94,4 +109,3 @@ simplify_and_colorize <- function(graph) { res$res } #' @export is.simple -deprecated("is.simple", is_simple) diff --git a/man/is.simple.Rd b/man/is.simple.Rd new file mode 100644 index 00000000000..2d4ecb434e6 --- /dev/null +++ b/man/is.simple.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/simple.R +\name{is.simple} +\alias{is.simple} +\title{Simple graphs} +\usage{ +is.simple(graph) +} +\arguments{ +\item{graph}{The graph to work on.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.simple()} was renamed to \code{is_simple()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/simplify.Rd b/man/simplify.Rd index 60cfcb6fe63..761cc95bf44 100644 --- a/man/simplify.Rd +++ b/man/simplify.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/simple.R \name{simplify} \alias{simplify} -\alias{is.simple} \alias{is_simple} \alias{simplify_and_colorize} \title{Simple graphs} From 2f800f104b0efe559a581973d2d7dbe7f8232131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:13:20 +0100 Subject: [PATCH 42/48] refactor!: change R/structural.properties.R --- R/structural.properties.R | 499 +++++++++++++++++++++++++----- man/average.path.length.Rd | 43 +++ man/bfs.Rd | 1 - man/clusters.Rd | 22 ++ man/components.Rd | 4 - man/coreness.Rd | 1 - man/count.multiple.Rd | 21 ++ man/degree.Rd | 1 - man/degree.distribution.Rd | 24 ++ man/dfs.Rd | 1 - man/diameter.Rd | 2 - man/distances.Rd | 5 - man/edge_density.Rd | 1 - man/ego.Rd | 3 - man/farthest.nodes.Rd | 31 ++ man/get.all.shortest.paths.Rd | 45 +++ man/get.diameter.Rd | 31 ++ man/get.shortest.paths.Rd | 81 +++++ man/graph.bfs.Rd | 76 +++++ man/graph.coreness.Rd | 23 ++ man/graph.density.Rd | 23 ++ man/graph.dfs.Rd | 69 +++++ man/graph.knn.Rd | 45 +++ man/graph.laplacian.Rd | 35 +++ man/graph.neighborhood.Rd | 38 +++ man/has.multiple.Rd | 18 ++ man/induced.subgraph.Rd | 34 ++ man/is.connected.Rd | 22 ++ man/is.loop.Rd | 21 ++ man/is.matching.Rd | 26 ++ man/is.maximal.matching.Rd | 26 ++ man/is.multiple.Rd | 21 ++ man/is.mutual.Rd | 21 ++ man/knn.Rd | 1 - man/laplacian_matrix.Rd | 1 - man/matching.Rd | 3 - man/maximum.bipartite.matching.Rd | 41 +++ man/neighborhood.size.Rd | 38 +++ man/shortest.paths.Rd | 56 ++++ man/subgraph.Rd | 1 - man/topo_sort.Rd | 1 - man/topological.sort.Rd | 24 ++ man/unfold.tree.Rd | 26 ++ man/unfold_tree.Rd | 1 - man/which_multiple.Rd | 4 - man/which_mutual.Rd | 1 - 46 files changed, 1405 insertions(+), 107 deletions(-) create mode 100644 man/average.path.length.Rd create mode 100644 man/clusters.Rd create mode 100644 man/count.multiple.Rd create mode 100644 man/degree.distribution.Rd create mode 100644 man/farthest.nodes.Rd create mode 100644 man/get.all.shortest.paths.Rd create mode 100644 man/get.diameter.Rd create mode 100644 man/get.shortest.paths.Rd create mode 100644 man/graph.bfs.Rd create mode 100644 man/graph.coreness.Rd create mode 100644 man/graph.density.Rd create mode 100644 man/graph.dfs.Rd create mode 100644 man/graph.knn.Rd create mode 100644 man/graph.laplacian.Rd create mode 100644 man/graph.neighborhood.Rd create mode 100644 man/has.multiple.Rd create mode 100644 man/induced.subgraph.Rd create mode 100644 man/is.connected.Rd create mode 100644 man/is.loop.Rd create mode 100644 man/is.matching.Rd create mode 100644 man/is.maximal.matching.Rd create mode 100644 man/is.multiple.Rd create mode 100644 man/is.mutual.Rd create mode 100644 man/maximum.bipartite.matching.Rd create mode 100644 man/neighborhood.size.Rd create mode 100644 man/shortest.paths.Rd create mode 100644 man/topological.sort.Rd create mode 100644 man/unfold.tree.Rd diff --git a/R/structural.properties.R b/R/structural.properties.R index 3a67652a7f6..cdee8108f8e 100644 --- a/R/structural.properties.R +++ b/R/structural.properties.R @@ -1,3 +1,423 @@ + +#' Shortest (directed or undirected) paths between vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.shortest.paths()` was renamed to `shortest_paths()` to create a more +#' consistent API. +#' @inheritParams shortest_paths +#' @keywords internal +#' @export +get.shortest.paths <- function(graph , from , to = V(graph) , mode = c("out","all","in") , weights = NULL , output = c("vpath","epath","both") , predecessors = FALSE , inbound.edges = FALSE , algorithm = c("automatic","unweighted","dijkstra","bellman-ford")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.shortest.paths()", "shortest_paths()") + shortest_paths(graph = graph, from = from, to = to, mode = mode, weights = weights, output = output, predecessors = predecessors, inbound.edges = inbound.edges, algorithm = algorithm) +} # nocov end + +#' Shortest (directed or undirected) paths between vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.all.shortest.paths()` was renamed to `all_shortest_paths()` to create a more +#' consistent API. +#' @inheritParams all_shortest_paths +#' @keywords internal +#' @export +get.all.shortest.paths <- function(graph , from , to = V(graph) , mode = c("out","all","in") , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.all.shortest.paths()", "all_shortest_paths()") + all_shortest_paths(graph = graph, from = from, to = to, mode = mode, weights = weights) +} # nocov end + +#' Diameter of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `get.diameter()` was renamed to `get_diameter()` to create a more +#' consistent API. +#' @inheritParams get_diameter +#' @keywords internal +#' @export +get.diameter <- function(graph , directed = TRUE , unconnected = TRUE , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "get.diameter()", "get_diameter()") + get_diameter(graph = graph, directed = directed, unconnected = unconnected, weights = weights) +} # nocov end + +#' Convert a general graph into a forest +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `unfold.tree()` was renamed to `unfold_tree()` to create a more +#' consistent API. +#' @inheritParams unfold_tree +#' @keywords internal +#' @export +unfold.tree <- function(graph , mode = c("all","out","in","total") , roots) { # nocov start + lifecycle::deprecate_soft("1.6.0", "unfold.tree()", "unfold_tree()") + unfold_tree(graph = graph, mode = mode, roots = roots) +} # nocov end + +#' Topological sorting of vertices in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `topological.sort()` was renamed to `topo_sort()` to create a more +#' consistent API. +#' @inheritParams topo_sort +#' @keywords internal +#' @export +topological.sort <- function(graph , mode = c("out","all","in")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "topological.sort()", "topo_sort()") + topo_sort(graph = graph, mode = mode) +} # nocov end + +#' Shortest (directed or undirected) paths between vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `shortest.paths()` was renamed to `distances()` to create a more +#' consistent API. +#' @inheritParams distances +#' @keywords internal +#' @export +shortest.paths <- function(graph , v = V(graph) , to = V(graph) , mode = c("all","out","in") , weights = NULL , algorithm = c("automatic","unweighted","dijkstra","bellman-ford","johnson")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "shortest.paths()", "distances()") + distances(graph = graph, v = v, to = to, mode = mode, weights = weights, algorithm = algorithm) +} # nocov end + +#' Neighborhood of graph vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `neighborhood.size()` was renamed to `ego_size()` to create a more +#' consistent API. +#' @inheritParams ego_size +#' @keywords internal +#' @export +neighborhood.size <- function(graph , order = 1 , nodes = V(graph) , mode = c("all","out","in") , mindist = 0) { # nocov start + lifecycle::deprecate_soft("1.6.0", "neighborhood.size()", "ego_size()") + ego_size(graph = graph, order = order, nodes = nodes, mode = mode, mindist = mindist) +} # nocov end + +#' Matching +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `maximum.bipartite.matching()` was renamed to `max_bipartite_match()` to create a more +#' consistent API. +#' @inheritParams max_bipartite_match +#' @keywords internal +#' @export +maximum.bipartite.matching <- function(graph , types = NULL , weights = NULL , eps = .Machine$double.eps) { # nocov start + lifecycle::deprecate_soft("1.6.0", "maximum.bipartite.matching()", "max_bipartite_match()") + max_bipartite_match(graph = graph, types = types, weights = weights, eps = eps) +} # nocov end + +#' Find mutual edges in a directed graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.mutual()` was renamed to `which_mutual()` to create a more +#' consistent API. +#' @inheritParams which_mutual +#' @keywords internal +#' @export +is.mutual <- function(graph , eids = E(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.mutual()", "which_mutual()") + which_mutual(graph = graph, eids = eids) +} # nocov end + +#' Find the multiple or loop edges in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.multiple()` was renamed to `which_multiple()` to create a more +#' consistent API. +#' @inheritParams which_multiple +#' @keywords internal +#' @export +is.multiple <- function(graph , eids = E(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.multiple()", "which_multiple()") + which_multiple(graph = graph, eids = eids) +} # nocov end + +#' Matching +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.maximal.matching()` was renamed to `is_max_matching()` to create a more +#' consistent API. +#' @inheritParams is_max_matching +#' @keywords internal +#' @export +is.maximal.matching <- function(graph , matching , types = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.maximal.matching()", "is_max_matching()") + is_max_matching(graph = graph, matching = matching, types = types) +} # nocov end + +#' Matching +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.matching()` was renamed to `is_matching()` to create a more +#' consistent API. +#' @inheritParams is_matching +#' @keywords internal +#' @export +is.matching <- function(graph , matching , types = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.matching()", "is_matching()") + is_matching(graph = graph, matching = matching, types = types) +} # nocov end + +#' Find the multiple or loop edges in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.loop()` was renamed to `which_loop()` to create a more +#' consistent API. +#' @inheritParams which_loop +#' @keywords internal +#' @export +is.loop <- function(graph , eids = E(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.loop()", "which_loop()") + which_loop(graph = graph, eids = eids) +} # nocov end + +#' Connected components of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `is.connected()` was renamed to `is_connected()` to create a more +#' consistent API. +#' @inheritParams is_connected +#' @keywords internal +#' @export +is.connected <- function(graph , mode = c("weak","strong")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "is.connected()", "is_connected()") + is_connected(graph = graph, mode = mode) +} # nocov end + +#' Subgraph of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `induced.subgraph()` was renamed to `induced_subgraph()` to create a more +#' consistent API. +#' @inheritParams induced_subgraph +#' @keywords internal +#' @export +induced.subgraph <- function(graph , vids , impl = c("auto","copy_and_delete","create_from_scratch")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "induced.subgraph()", "induced_subgraph()") + induced_subgraph(graph = graph, vids = vids, impl = impl) +} # nocov end + +#' Find the multiple or loop edges in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `has.multiple()` was renamed to `any_multiple()` to create a more +#' consistent API. +#' @inheritParams any_multiple +#' @keywords internal +#' @export +has.multiple <- function(graph) { # nocov start + lifecycle::deprecate_soft("1.6.0", "has.multiple()", "any_multiple()") + any_multiple(graph = graph) +} # nocov end + +#' Neighborhood of graph vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.neighborhood()` was renamed to `make_ego_graph()` to create a more +#' consistent API. +#' @inheritParams make_ego_graph +#' @keywords internal +#' @export +graph.neighborhood <- function(graph , order = 1 , nodes = V(graph) , mode = c("all","out","in") , mindist = 0) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.neighborhood()", "make_ego_graph()") + make_ego_graph(graph = graph, order = order, nodes = nodes, mode = mode, mindist = mindist) +} # nocov end + +#' Graph Laplacian +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.laplacian()` was renamed to `laplacian_matrix()` to create a more +#' consistent API. +#' @inheritParams laplacian_matrix +#' @keywords internal +#' @export +graph.laplacian <- function(graph , normalized = FALSE , weights = NULL , sparse = igraph_opt("sparsematrices")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.laplacian()", "laplacian_matrix()") + laplacian_matrix(graph = graph, normalized = normalized, weights = weights, sparse = sparse) +} # nocov end + +#' Average nearest neighbor degree +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.knn()` was renamed to `knn()` to create a more +#' consistent API. +#' @inheritParams knn +#' @keywords internal +#' @export +graph.knn <- function(graph , vids = V(graph) , mode = c("all","out","in","total") , neighbor.degree.mode = c("all","out","in","total") , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.knn()", "knn()") + knn(graph = graph, vids = vids, mode = mode, neighbor.degree.mode = neighbor.degree.mode, weights = weights) +} # nocov end + +#' Depth-first search +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.dfs()` was renamed to `dfs()` to create a more +#' consistent API. +#' @inheritParams dfs +#' @keywords internal +#' @export +graph.dfs <- function(graph , root , mode = c("out","in","all","total") , unreachable = TRUE , order = TRUE , order.out = FALSE , father = FALSE , dist = FALSE , in.callback = NULL , out.callback = NULL , extra = NULL , rho = parent.frame() , neimode) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.dfs()", "dfs()") + dfs(graph = graph, root = root, mode = mode, unreachable = unreachable, order = order, order.out = order.out, father = father, dist = dist, in.callback = in.callback, out.callback = out.callback, extra = extra, rho = rho, neimode = neimode) +} # nocov end + +#' Graph density +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.density()` was renamed to `edge_density()` to create a more +#' consistent API. +#' @inheritParams edge_density +#' @keywords internal +#' @export +graph.density <- function(graph , loops = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.density()", "edge_density()") + edge_density(graph = graph, loops = loops) +} # nocov end + +#' K-core decomposition of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.coreness()` was renamed to `coreness()` to create a more +#' consistent API. +#' @inheritParams coreness +#' @keywords internal +#' @export +graph.coreness <- function(graph , mode = c("all","out","in")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.coreness()", "coreness()") + coreness(graph = graph, mode = mode) +} # nocov end + +#' Breadth-first search +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.bfs()` was renamed to `bfs()` to create a more +#' consistent API. +#' @inheritParams bfs +#' @keywords internal +#' @export +graph.bfs <- function(graph , root , mode = c("out","in","all","total") , unreachable = TRUE , restricted = NULL , order = TRUE , rank = FALSE , father = FALSE , pred = FALSE , succ = FALSE , dist = FALSE , callback = NULL , extra = NULL , rho = parent.frame() , neimode) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.bfs()", "bfs()") + bfs(graph = graph, root = root, mode = mode, unreachable = unreachable, restricted = restricted, order = order, rank = rank, father = father, pred = pred, succ = succ, dist = dist, callback = callback, extra = extra, rho = rho, neimode = neimode) +} # nocov end + +#' Diameter of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `farthest.nodes()` was renamed to `farthest_vertices()` to create a more +#' consistent API. +#' @inheritParams farthest_vertices +#' @keywords internal +#' @export +farthest.nodes <- function(graph , directed = TRUE , unconnected = TRUE , weights = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "farthest.nodes()", "farthest_vertices()") + farthest_vertices(graph = graph, directed = directed, unconnected = unconnected, weights = weights) +} # nocov end + +#' Degree and degree distribution of the vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `degree.distribution()` was renamed to `degree_distribution()` to create a more +#' consistent API. +#' @inheritParams degree_distribution +#' @keywords internal +#' @export +degree.distribution <- function(graph , cumulative = FALSE , ...) { # nocov start + lifecycle::deprecate_soft("1.6.0", "degree.distribution()", "degree_distribution()") + degree_distribution(graph = graph, cumulative = cumulative, ...) +} # nocov end + +#' Find the multiple or loop edges in a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `count.multiple()` was renamed to `count_multiple()` to create a more +#' consistent API. +#' @inheritParams count_multiple +#' @keywords internal +#' @export +count.multiple <- function(graph , eids = E(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "count.multiple()", "count_multiple()") + count_multiple(graph = graph, eids = eids) +} # nocov end + +#' Connected components of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `clusters()` was renamed to `components()` to create a more +#' consistent API. +#' @inheritParams components +#' @keywords internal +#' @export +clusters <- function(graph , mode = c("weak","strong")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "clusters()", "components()") + components(graph = graph, mode = mode) +} # nocov end + +#' Shortest (directed or undirected) paths between vertices +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `average.path.length()` was renamed to `mean_distance()` to create a more +#' consistent API. +#' @inheritParams mean_distance +#' @keywords internal +#' @export +average.path.length <- function(graph , weights = NULL , directed = TRUE , unconnected = TRUE , details = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "average.path.length()", "mean_distance()") + mean_distance(graph = graph, weights = weights, directed = directed, unconnected = unconnected, details = details) +} # nocov end # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -38,7 +458,6 @@ #' `farthest_vertices()` returns two vertex ids, the vertices which are #' connected by the diameter path. #' -#' @aliases get.diameter farthest.nodes #' @param graph The graph to analyze. #' @param directed Logical, whether directed or undirected paths are to be #' considered. This is ignored for undirected graphs. @@ -165,7 +584,6 @@ mean_distance <- average_path_length_dijkstra_impl #' its adjacent edges. #' #' -#' @aliases degree.distribution #' @param graph The graph to analyze. #' @param v The ids of vertices of which the degree will be calculated. #' @param mode Character string, \dQuote{out} for out-degree, \dQuote{in} for @@ -295,8 +713,6 @@ degree_distribution <- function(graph, cumulative = FALSE, ...) { #' directions are considered, so every pair of vertices appears twice in the #' histogram. #' -#' @aliases shortest.paths get.shortest.paths get.all.shortest.paths -#' average.path.length path.length.hist #' @param graph The graph to work on. #' @param v Numeric vector, the vertices from which the shortest paths will be #' calculated. @@ -707,7 +1123,7 @@ subcomponent <- function(graph, v, mode = c("all", "out", "in")) { #' is deprecated. In the next major version, `subgraph()` will overtake the #' functionality of `subgraph.edges()`. #' -#' @aliases induced.subgraph subgraph.edges +#' @aliases subgraph.edges #' @param graph The original graph. #' @return A new graph object. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} @@ -1062,7 +1478,6 @@ reciprocity <- function(graph, ignore.loops = TRUE, #' does not check whether the graph has multi-edges and will return meaningless #' results for such graphs. #' -#' @aliases graph.density #' @param graph The input graph. #' @param loops Logical constant, whether loop edges may exist in the graph. #' This affects the calculation of the largest possible number of edges in the @@ -1149,8 +1564,8 @@ neighborhood_size <- ego_size #' `connect()` creates a new graph by connecting each vertex to #' all other vertices in its neighborhood. #' -#' @aliases neighborhood neighborhood.size graph.neighborhood ego_graph -#' connect.neighborhood connect ego_size ego +#' @aliases neighborhood ego_graph +#' @aliases connect ego_size ego #' @param graph The input graph. #' @param order Integer giving the order of the neighborhood. #' @param nodes The vertices for which the calculation is performed. @@ -1275,7 +1690,6 @@ make_neighborhood_graph <- make_ego_graph #' #' This function calculates the coreness for each vertex. #' -#' @aliases graph.coreness #' @param graph The input graph, it can be directed or undirected #' @param mode The type of the core in directed graphs. Character constant, #' possible values: `in`: in-cores are computed, `out`: out-cores are @@ -1328,7 +1742,6 @@ coreness <- function(graph, mode = c("all", "out", "in")) { #' acyclic (it has at least one cycle), a partial topological sort is returned #' and a warning is issued. #' -#' @aliases topological.sort #' @param graph The input graph, should be directed #' @param mode Specifies how to use the direction of the edges. For #' \dQuote{`out`}, the sorting order ensures that each node comes before @@ -1486,7 +1899,6 @@ girth <- function(graph, circle = TRUE) { #' See the examples for getting rid of multiple edges while keeping their #' original multiplicity as an edge attribute. #' -#' @aliases has.multiple is.loop is.multiple count.multiple #' @param graph The input graph. #' @param eids The edges to which the query is restricted. By default this is #' all edges in the graph. @@ -1561,7 +1973,6 @@ any_loop <- has_loop_impl #' to continue the search or `TRUE` to terminate it. See examples below on how to #' use the callback function. #' -#' @aliases graph.bfs #' @param graph The input graph. #' @param root Numeric vector, usually of length one. The root vertex, or root #' vertices to start the search from. @@ -1750,7 +2161,6 @@ bfs <- function( #' argument.} } The callback must return FALSE to continue the search or TRUE #' to terminate it. See examples below on how to use the callback functions. #' -#' @aliases graph.dfs #' @param graph The input graph. #' @param root The single root vertex to start the search from. #' @param mode For directed graphs specifies the type of edges to follow. @@ -1908,7 +2318,6 @@ dfs <- function(graph, root, mode = c("out", "in", "all", "total"), #' The strongly connected components are implemented by two consecutive #' depth-first searches. #' -#' @aliases no.clusters clusters is.connected cluster.distribution #' @param graph The graph to analyze. #' @param mode Character string, either \dQuote{weak} or \dQuote{strong}. For #' directed graphs \dQuote{weak} implies weakly, \dQuote{strong} strongly @@ -1977,7 +2386,6 @@ count_components <- count_components #' The `roots` vector can be calculated by simply doing a topological sort #' in all components of the graph, see the examples below. #' -#' @aliases unfold.tree #' @param graph The input graph, it can be either directed or undirected. #' @param mode Character string, defined the types of the paths used for the #' breadth-first search. \dQuote{out} follows the outgoing, \dQuote{in} the @@ -2038,7 +2446,6 @@ unfold_tree <- function(graph, mode = c("all", "out", "in", "total"), roots) { #' j with weight w, and 0 otherwise. The weighted degree of a vertex is the sum #' of the weights of its adjacent edges. #' -#' @aliases graph.laplacian #' @param graph The input graph. #' @param normalized Whether to calculate the normalized Laplacian. See #' definitions below. @@ -2121,8 +2528,7 @@ laplacian_matrix <- function(graph, normalized = FALSE, weights = NULL, #' \eqn{n/2} steps where \eqn{n} is the number of vertices in the graph. #' #' @rdname matching -#' @aliases is.matching is.maximal.matching -#' maximum.bipartite.matching max_bipartite_match +#' @aliases max_bipartite_match #' @param graph The input graph. It might be directed, but edge directions will #' be ignored. #' @param types Vertex types, if the graph is bipartite. By default they @@ -2254,7 +2660,6 @@ max_bipartite_match <- function(graph, types = NULL, weights = NULL, #' #' Undirected graphs contain only mutual edges by definition. #' -#' @aliases is.mutual #' @param graph The input graph. #' @param eids Edge sequence, the edges that will be probed. By default is #' includes all edges in the order of their ids. @@ -2294,7 +2699,6 @@ which_mutual <- is_mutual_impl #' as indicated by `mode`. \eqn{w_{uv}}{w_uv} denotes the weighted adjacency matrix #' and \eqn{k_v}{k_v} is the neighbors' degree, specified by `neighbor_degree_mode`. #' -#' @aliases graph.knn #' @param graph The input graph. It may be directed. #' @param vids The vertices for which the calculation is performed. Normally it #' includes all vertices. Note, that if not all vertices are given here, then @@ -2347,58 +2751,3 @@ which_mutual <- is_mutual_impl #' @export knn <- avg_nearest_neighbor_degree_impl #' @export average.path.length -deprecated("average.path.length", mean_distance) -#' @export clusters -deprecated("clusters", components) -#' @export count.multiple -deprecated("count.multiple", count_multiple) -#' @export degree.distribution -deprecated("degree.distribution", degree_distribution) -#' @export farthest.nodes -deprecated("farthest.nodes", farthest_vertices) -#' @export graph.bfs -deprecated("graph.bfs", bfs) -#' @export graph.coreness -deprecated("graph.coreness", coreness) -#' @export graph.density -deprecated("graph.density", edge_density) -#' @export graph.dfs -deprecated("graph.dfs", dfs) -#' @export graph.knn -deprecated("graph.knn", knn) -#' @export graph.laplacian -deprecated("graph.laplacian", laplacian_matrix) -#' @export graph.neighborhood -deprecated("graph.neighborhood", make_ego_graph) -#' @export has.multiple -deprecated("has.multiple", any_multiple) -#' @export induced.subgraph -deprecated("induced.subgraph", induced_subgraph) -#' @export is.connected -deprecated("is.connected", is_connected) -#' @export is.loop -deprecated("is.loop", which_loop) -#' @export is.matching -deprecated("is.matching", is_matching) -#' @export is.maximal.matching -deprecated("is.maximal.matching", is_max_matching) -#' @export is.multiple -deprecated("is.multiple", which_multiple) -#' @export is.mutual -deprecated("is.mutual", which_mutual) -#' @export maximum.bipartite.matching -deprecated("maximum.bipartite.matching", max_bipartite_match) -#' @export neighborhood.size -deprecated("neighborhood.size", ego_size) -#' @export shortest.paths -deprecated("shortest.paths", distances) -#' @export topological.sort -deprecated("topological.sort", topo_sort) -#' @export unfold.tree -deprecated("unfold.tree", unfold_tree) -#' @export get.diameter -deprecated("get.diameter", get_diameter) -#' @export get.all.shortest.paths -deprecated("get.all.shortest.paths", all_shortest_paths) -#' @export get.shortest.paths -deprecated("get.shortest.paths", shortest_paths) diff --git a/man/average.path.length.Rd b/man/average.path.length.Rd new file mode 100644 index 00000000000..0ecb47a7177 --- /dev/null +++ b/man/average.path.length.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{average.path.length} +\alias{average.path.length} +\title{Shortest (directed or undirected) paths between vertices} +\usage{ +average.path.length( + graph, + weights = NULL, + directed = TRUE, + unconnected = TRUE, + details = FALSE +) +} +\arguments{ +\item{graph}{The graph to work on.} + +\item{weights}{Possibly a numeric vector giving edge weights. If this is +\code{NULL} and the graph has a \code{weight} edge attribute, then the +attribute is used. If this is \code{NA} then no weights are used (even if +the graph has a \code{weight} attribute).} + +\item{directed}{Whether to consider directed paths in directed graphs, +this argument is ignored for undirected graphs.} + +\item{unconnected}{What to do if the graph is unconnected (not +strongly connected if directed paths are considered). If TRUE, only +the lengths of the existing paths are considered and averaged; if +FALSE, the length of the missing paths are considered as having infinite +length, making the mean distance infinite as well.} + +\item{details}{Whether to provide additional details in the result. +Functions accepting this argument (like \code{mean_distance()}) return +additional information like the number of disconnected vertex pairs in +the result when this parameter is set to \code{TRUE}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{average.path.length()} was renamed to \code{mean_distance()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/bfs.Rd b/man/bfs.Rd index b41dec5bf9c..3d87cba237b 100644 --- a/man/bfs.Rd +++ b/man/bfs.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{bfs} \alias{bfs} -\alias{graph.bfs} \title{Breadth-first search} \usage{ bfs( diff --git a/man/clusters.Rd b/man/clusters.Rd new file mode 100644 index 00000000000..97f9f8ca067 --- /dev/null +++ b/man/clusters.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{clusters} +\alias{clusters} +\title{Connected components of a graph} +\usage{ +clusters(graph, mode = c("weak", "strong")) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{clusters()} was renamed to \code{components()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/components.Rd b/man/components.Rd index 94e9051932d..8e691926e4b 100644 --- a/man/components.Rd +++ b/man/components.Rd @@ -4,10 +4,6 @@ \alias{component_distribution} \alias{largest_component} \alias{components} -\alias{no.clusters} -\alias{clusters} -\alias{is.connected} -\alias{cluster.distribution} \alias{is_connected} \alias{count_components} \title{Connected components of a graph} diff --git a/man/coreness.Rd b/man/coreness.Rd index 271be1efb07..e8036699c3e 100644 --- a/man/coreness.Rd +++ b/man/coreness.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{coreness} \alias{coreness} -\alias{graph.coreness} \title{K-core decomposition of graphs} \usage{ coreness(graph, mode = c("all", "out", "in")) diff --git a/man/count.multiple.Rd b/man/count.multiple.Rd new file mode 100644 index 00000000000..010fcb9f93a --- /dev/null +++ b/man/count.multiple.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{count.multiple} +\alias{count.multiple} +\title{Find the multiple or loop edges in a graph} +\usage{ +count.multiple(graph, eids = E(graph)) +} +\arguments{ +\item{graph}{The input graph.} + +\item{eids}{The edges to which the query is restricted. By default this is +all edges in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{count.multiple()} was renamed to \code{count_multiple()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/degree.Rd b/man/degree.Rd index c69b416957d..e7f49c3f960 100644 --- a/man/degree.Rd +++ b/man/degree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{degree} \alias{degree} -\alias{degree.distribution} \alias{degree_distribution} \title{Degree and degree distribution of the vertices} \usage{ diff --git a/man/degree.distribution.Rd b/man/degree.distribution.Rd new file mode 100644 index 00000000000..945b67d45d6 --- /dev/null +++ b/man/degree.distribution.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{degree.distribution} +\alias{degree.distribution} +\title{Degree and degree distribution of the vertices} +\usage{ +degree.distribution(graph, cumulative = FALSE, ...) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{cumulative}{Logical; whether the cumulative degree distribution is to +be calculated.} + +\item{...}{Additional arguments to pass to \code{degree()}, e.g. \code{mode} +is useful but also \code{v} and \code{loops} make sense.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{degree.distribution()} was renamed to \code{degree_distribution()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/dfs.Rd b/man/dfs.Rd index f2d01b80c4f..91fa4acca7b 100644 --- a/man/dfs.Rd +++ b/man/dfs.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{dfs} \alias{dfs} -\alias{graph.dfs} \title{Depth-first search} \usage{ dfs( diff --git a/man/diameter.Rd b/man/diameter.Rd index 728975e5b5a..f791e616f87 100644 --- a/man/diameter.Rd +++ b/man/diameter.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{diameter} \alias{diameter} -\alias{get.diameter} -\alias{farthest.nodes} \alias{get_diameter} \alias{farthest_vertices} \title{Diameter of a graph} diff --git a/man/distances.Rd b/man/distances.Rd index 8f121c2c9d9..4b1ee5ef1bf 100644 --- a/man/distances.Rd +++ b/man/distances.Rd @@ -4,11 +4,6 @@ \alias{distance_table} \alias{mean_distance} \alias{distances} -\alias{shortest.paths} -\alias{get.shortest.paths} -\alias{get.all.shortest.paths} -\alias{average.path.length} -\alias{path.length.hist} \alias{shortest_paths} \alias{all_shortest_paths} \title{Shortest (directed or undirected) paths between vertices} diff --git a/man/edge_density.Rd b/man/edge_density.Rd index dea8b29213b..3c3340b821f 100644 --- a/man/edge_density.Rd +++ b/man/edge_density.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{edge_density} \alias{edge_density} -\alias{graph.density} \title{Graph density} \usage{ edge_density(graph, loops = FALSE) diff --git a/man/ego.Rd b/man/ego.Rd index 39aa3996b62..e6d3bc34879 100644 --- a/man/ego.Rd +++ b/man/ego.Rd @@ -6,10 +6,7 @@ \alias{neighborhood_size} \alias{ego} \alias{neighborhood} -\alias{neighborhood.size} -\alias{graph.neighborhood} \alias{ego_graph} -\alias{connect.neighborhood} \alias{make_ego_graph} \alias{make_neighborhood_graph} \title{Neighborhood of graph vertices} diff --git a/man/farthest.nodes.Rd b/man/farthest.nodes.Rd new file mode 100644 index 00000000000..9a0df816430 --- /dev/null +++ b/man/farthest.nodes.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{farthest.nodes} +\alias{farthest.nodes} +\title{Diameter of a graph} +\usage{ +farthest.nodes(graph, directed = TRUE, unconnected = TRUE, weights = NULL) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{directed}{Logical, whether directed or undirected paths are to be +considered. This is ignored for undirected graphs.} + +\item{unconnected}{Logical, what to do if the graph is unconnected. If +FALSE, the function will return a number that is one larger the largest +possible diameter, which is always the number of vertices. If TRUE, the +diameters of the connected components will be calculated and the largest one +will be returned.} + +\item{weights}{Optional positive weight vector for calculating weighted +distances. If the graph has a \code{weight} edge attribute, then this is +used by default.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{farthest.nodes()} was renamed to \code{farthest_vertices()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.all.shortest.paths.Rd b/man/get.all.shortest.paths.Rd new file mode 100644 index 00000000000..5d6b2ac4886 --- /dev/null +++ b/man/get.all.shortest.paths.Rd @@ -0,0 +1,45 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{get.all.shortest.paths} +\alias{get.all.shortest.paths} +\title{Shortest (directed or undirected) paths between vertices} +\usage{ +get.all.shortest.paths( + graph, + from, + to = V(graph), + mode = c("out", "all", "in"), + weights = NULL +) +} +\arguments{ +\item{graph}{The graph to work on.} + +\item{from}{Numeric constant, the vertex from or to the shortest paths will +be calculated. Note that right now this is not a vector of vertex ids, but +only a single vertex.} + +\item{to}{Numeric vector, the vertices to which the shortest paths will be +calculated. By default it includes all vertices. Note that for +\code{distances()} every vertex must be included here at most once. (This +is not required for \code{shortest_paths()}.} + +\item{mode}{Character constant, gives whether the shortest paths to or from +the given vertices should be calculated for directed graphs. If \code{out} +then the shortest paths \emph{from} the vertex, if \verb{in} then \emph{to} +it will be considered. If \code{all}, the default, then the corresponding +undirected graph will be used, i.e. not directed paths are searched. This +argument is ignored for undirected graphs.} + +\item{weights}{Possibly a numeric vector giving edge weights. If this is +\code{NULL} and the graph has a \code{weight} edge attribute, then the +attribute is used. If this is \code{NA} then no weights are used (even if +the graph has a \code{weight} attribute).} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.all.shortest.paths()} was renamed to \code{all_shortest_paths()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.diameter.Rd b/man/get.diameter.Rd new file mode 100644 index 00000000000..c2be3a432fb --- /dev/null +++ b/man/get.diameter.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{get.diameter} +\alias{get.diameter} +\title{Diameter of a graph} +\usage{ +get.diameter(graph, directed = TRUE, unconnected = TRUE, weights = NULL) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{directed}{Logical, whether directed or undirected paths are to be +considered. This is ignored for undirected graphs.} + +\item{unconnected}{Logical, what to do if the graph is unconnected. If +FALSE, the function will return a number that is one larger the largest +possible diameter, which is always the number of vertices. If TRUE, the +diameters of the connected components will be calculated and the largest one +will be returned.} + +\item{weights}{Optional positive weight vector for calculating weighted +distances. If the graph has a \code{weight} edge attribute, then this is +used by default.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.diameter()} was renamed to \code{get_diameter()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/get.shortest.paths.Rd b/man/get.shortest.paths.Rd new file mode 100644 index 00000000000..38077feeae4 --- /dev/null +++ b/man/get.shortest.paths.Rd @@ -0,0 +1,81 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{get.shortest.paths} +\alias{get.shortest.paths} +\title{Shortest (directed or undirected) paths between vertices} +\usage{ +get.shortest.paths( + graph, + from, + to = V(graph), + mode = c("out", "all", "in"), + weights = NULL, + output = c("vpath", "epath", "both"), + predecessors = FALSE, + inbound.edges = FALSE, + algorithm = c("automatic", "unweighted", "dijkstra", "bellman-ford") +) +} +\arguments{ +\item{graph}{The graph to work on.} + +\item{from}{Numeric constant, the vertex from or to the shortest paths will +be calculated. Note that right now this is not a vector of vertex ids, but +only a single vertex.} + +\item{to}{Numeric vector, the vertices to which the shortest paths will be +calculated. By default it includes all vertices. Note that for +\code{distances()} every vertex must be included here at most once. (This +is not required for \code{shortest_paths()}.} + +\item{mode}{Character constant, gives whether the shortest paths to or from +the given vertices should be calculated for directed graphs. If \code{out} +then the shortest paths \emph{from} the vertex, if \verb{in} then \emph{to} +it will be considered. If \code{all}, the default, then the corresponding +undirected graph will be used, i.e. not directed paths are searched. This +argument is ignored for undirected graphs.} + +\item{weights}{Possibly a numeric vector giving edge weights. If this is +\code{NULL} and the graph has a \code{weight} edge attribute, then the +attribute is used. If this is \code{NA} then no weights are used (even if +the graph has a \code{weight} attribute).} + +\item{output}{Character scalar, defines how to report the shortest paths. +\dQuote{vpath} means that the vertices along the paths are reported, this +form was used prior to igraph version 0.6. \dQuote{epath} means that the +edges along the paths are reported. \dQuote{both} means that both forms are +returned, in a named list with components \dQuote{vpath} and \dQuote{epath}.} + +\item{predecessors}{Logical scalar, whether to return the predecessor vertex +for each vertex. The predecessor of vertex \code{i} in the tree is the +vertex from which vertex \code{i} was reached. The predecessor of the start +vertex (in the \code{from} argument) is itself by definition. If the +predecessor is zero, it means that the given vertex was not reached from the +source during the search. Note that the search terminates if all the +vertices in \code{to} are reached.} + +\item{inbound.edges}{Logical scalar, whether to return the inbound edge for +each vertex. The inbound edge of vertex \code{i} in the tree is the edge via +which vertex \code{i} was reached. The start vertex and vertices that were +not reached during the search will have zero in the corresponding entry of +the vector. Note that the search terminates if all the vertices in \code{to} +are reached.} + +\item{algorithm}{Which algorithm to use for the calculation. By default +igraph tries to select the fastest suitable algorithm. If there are no +weights, then an unweighted breadth-first search is used, otherwise if all +weights are positive, then Dijkstra's algorithm is used. If there are +negative weights and we do the calculation for more than 100 sources, then +Johnson's algorithm is used. Otherwise the Bellman-Ford algorithm is used. +You can override igraph's choice by explicitly giving this parameter. Note +that the igraph C core might still override your choice in obvious cases, +i.e. if there are no edge weights, then the unweighted algorithm will be +used, regardless of this argument.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{get.shortest.paths()} was renamed to \code{shortest_paths()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.bfs.Rd b/man/graph.bfs.Rd new file mode 100644 index 00000000000..ecd08ff2e24 --- /dev/null +++ b/man/graph.bfs.Rd @@ -0,0 +1,76 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.bfs} +\alias{graph.bfs} +\title{Breadth-first search} +\usage{ +graph.bfs( + graph, + root, + mode = c("out", "in", "all", "total"), + unreachable = TRUE, + restricted = NULL, + order = TRUE, + rank = FALSE, + father = FALSE, + pred = FALSE, + succ = FALSE, + dist = FALSE, + callback = NULL, + extra = NULL, + rho = parent.frame(), + neimode +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{root}{Numeric vector, usually of length one. The root vertex, or root +vertices to start the search from.} + +\item{mode}{For directed graphs specifies the type of edges to follow. +\sQuote{out} follows outgoing, \sQuote{in} incoming edges. \sQuote{all} +ignores edge directions completely. \sQuote{total} is a synonym for +\sQuote{all}. This argument is ignored for undirected graphs.} + +\item{unreachable}{Logical scalar, whether the search should visit the +vertices that are unreachable from the given root vertex (or vertices). If +\code{TRUE}, then additional searches are performed until all vertices are +visited.} + +\item{restricted}{\code{NULL} (=no restriction), or a vector of vertices +(ids or symbolic names). In the latter case, the search is restricted to the +given vertices.} + +\item{order}{Logical scalar, whether to return the ordering of the vertices.} + +\item{rank}{Logical scalar, whether to return the rank of the vertices.} + +\item{father}{Logical scalar, whether to return the father of the vertices.} + +\item{pred}{Logical scalar, whether to return the predecessors of the +vertices.} + +\item{succ}{Logical scalar, whether to return the successors of the +vertices.} + +\item{dist}{Logical scalar, whether to return the distance from the root of +the search tree.} + +\item{callback}{If not \code{NULL}, then it must be callback function. This +is called whenever a vertex is visited. See details below.} + +\item{extra}{Additional argument to supply to the callback function.} + +\item{rho}{The environment in which the callback function is evaluated.} + +\item{neimode}{This argument is deprecated from igraph 1.3.0; use +\code{mode} instead.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.bfs()} was renamed to \code{bfs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.coreness.Rd b/man/graph.coreness.Rd new file mode 100644 index 00000000000..7c78b7efaa7 --- /dev/null +++ b/man/graph.coreness.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.coreness} +\alias{graph.coreness} +\title{K-core decomposition of graphs} +\usage{ +graph.coreness(graph, mode = c("all", "out", "in")) +} +\arguments{ +\item{graph}{The input graph, it can be directed or undirected} + +\item{mode}{The type of the core in directed graphs. Character constant, +possible values: \verb{in}: in-cores are computed, \code{out}: out-cores are +computed, \code{all}: the corresponding undirected graph is considered. This +argument is ignored for undirected graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.coreness()} was renamed to \code{coreness()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.density.Rd b/man/graph.density.Rd new file mode 100644 index 00000000000..f18365e9a48 --- /dev/null +++ b/man/graph.density.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.density} +\alias{graph.density} +\title{Graph density} +\usage{ +graph.density(graph, loops = FALSE) +} +\arguments{ +\item{graph}{The input graph.} + +\item{loops}{Logical constant, whether loop edges may exist in the graph. +This affects the calculation of the largest possible number of edges in the +graph. If this parameter is set to FALSE yet the graph contains self-loops, +the result will not be meaningful.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.density()} was renamed to \code{edge_density()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.dfs.Rd b/man/graph.dfs.Rd new file mode 100644 index 00000000000..581c4b7f88d --- /dev/null +++ b/man/graph.dfs.Rd @@ -0,0 +1,69 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.dfs} +\alias{graph.dfs} +\title{Depth-first search} +\usage{ +graph.dfs( + graph, + root, + mode = c("out", "in", "all", "total"), + unreachable = TRUE, + order = TRUE, + order.out = FALSE, + father = FALSE, + dist = FALSE, + in.callback = NULL, + out.callback = NULL, + extra = NULL, + rho = parent.frame(), + neimode +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{root}{The single root vertex to start the search from.} + +\item{mode}{For directed graphs specifies the type of edges to follow. +\sQuote{out} follows outgoing, \sQuote{in} incoming edges. \sQuote{all} +ignores edge directions completely. \sQuote{total} is a synonym for +\sQuote{all}. This argument is ignored for undirected graphs.} + +\item{unreachable}{Logical scalar, whether the search should visit the +vertices that are unreachable from the given root vertex (or vertices). If +\code{TRUE}, then additional searches are performed until all vertices are +visited.} + +\item{order}{Logical scalar, whether to return the DFS ordering of the +vertices.} + +\item{order.out}{Logical scalar, whether to return the ordering based on +leaving the subtree of the vertex.} + +\item{father}{Logical scalar, whether to return the father of the vertices.} + +\item{dist}{Logical scalar, whether to return the distance from the root of +the search tree.} + +\item{in.callback}{If not \code{NULL}, then it must be callback function. +This is called whenever a vertex is visited. See details below.} + +\item{out.callback}{If not \code{NULL}, then it must be callback function. +This is called whenever the subtree of a vertex is completed by the +algorithm. See details below.} + +\item{extra}{Additional argument to supply to the callback function.} + +\item{rho}{The environment in which the callback function is evaluated.} + +\item{neimode}{This argument is deprecated from igraph 1.3.0; use +\code{mode} instead.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.dfs()} was renamed to \code{dfs()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.knn.Rd b/man/graph.knn.Rd new file mode 100644 index 00000000000..26a0b409775 --- /dev/null +++ b/man/graph.knn.Rd @@ -0,0 +1,45 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.knn} +\alias{graph.knn} +\title{Average nearest neighbor degree} +\usage{ +graph.knn( + graph, + vids = V(graph), + mode = c("all", "out", "in", "total"), + neighbor.degree.mode = c("all", "out", "in", "total"), + weights = NULL +) +} +\arguments{ +\item{graph}{The input graph. It may be directed.} + +\item{vids}{The vertices for which the calculation is performed. Normally it +includes all vertices. Note, that if not all vertices are given here, then +both \sQuote{\code{knn}} and \sQuote{\code{knnk}} will be calculated based +on the given vertices only.} + +\item{mode}{Character constant to indicate the type of neighbors to consider +in directed graphs. \code{out} considers out-neighbors, \verb{in} considers +in-neighbors and \code{all} ignores edge directions.} + +\item{neighbor.degree.mode}{The type of degree to average in directed graphs. +\code{out} averages out-degrees, \verb{in} averages in-degrees and \code{all} +ignores edge directions for the degree calculation.} + +\item{weights}{Weight vector. If the graph has a \code{weight} edge +attribute, then this is used by default. If this argument is given, then +vertex strength (see \code{\link[=strength]{strength()}}) is used instead of vertex +degree. But note that \code{knnk} is still given in the function of the +normal vertex degree. +Weights are are used to calculate a weighted degree (also called +\code{\link[=strength]{strength()}}) instead of the degree.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.knn()} was renamed to \code{knn()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.laplacian.Rd b/man/graph.laplacian.Rd new file mode 100644 index 00000000000..66471f23ef1 --- /dev/null +++ b/man/graph.laplacian.Rd @@ -0,0 +1,35 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.laplacian} +\alias{graph.laplacian} +\title{Graph Laplacian} +\usage{ +graph.laplacian( + graph, + normalized = FALSE, + weights = NULL, + sparse = igraph_opt("sparsematrices") +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{normalized}{Whether to calculate the normalized Laplacian. See +definitions below.} + +\item{weights}{An optional vector giving edge weights for weighted Laplacian +matrix. If this is \code{NULL} and the graph has an edge attribute called +\code{weight}, then it will be used automatically. Set this to \code{NA} if +you want the unweighted Laplacian on a graph that has a \code{weight} edge +attribute.} + +\item{sparse}{Logical scalar, whether to return the result as a sparse +matrix. The \code{Matrix} package is required for sparse matrices.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.laplacian()} was renamed to \code{laplacian_matrix()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.neighborhood.Rd b/man/graph.neighborhood.Rd new file mode 100644 index 00000000000..48599100271 --- /dev/null +++ b/man/graph.neighborhood.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{graph.neighborhood} +\alias{graph.neighborhood} +\title{Neighborhood of graph vertices} +\usage{ +graph.neighborhood( + graph, + order = 1, + nodes = V(graph), + mode = c("all", "out", "in"), + mindist = 0 +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{order}{Integer giving the order of the neighborhood.} + +\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 +vertex in at most \code{order} steps are counted. For \sQuote{"in"} all +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{mindist}{The minimum distance to include the vertex in the result.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.neighborhood()} was renamed to \code{make_ego_graph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/has.multiple.Rd b/man/has.multiple.Rd new file mode 100644 index 00000000000..a40b1389519 --- /dev/null +++ b/man/has.multiple.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{has.multiple} +\alias{has.multiple} +\title{Find the multiple or loop edges in a graph} +\usage{ +has.multiple(graph) +} +\arguments{ +\item{graph}{The input graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{has.multiple()} was renamed to \code{any_multiple()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/induced.subgraph.Rd b/man/induced.subgraph.Rd new file mode 100644 index 00000000000..2c976ca6c70 --- /dev/null +++ b/man/induced.subgraph.Rd @@ -0,0 +1,34 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{induced.subgraph} +\alias{induced.subgraph} +\title{Subgraph of a graph} +\usage{ +induced.subgraph( + graph, + vids, + impl = c("auto", "copy_and_delete", "create_from_scratch") +) +} +\arguments{ +\item{graph}{The original graph.} + +\item{vids}{Numeric vector, the vertices of the original graph which will +form the subgraph.} + +\item{impl}{Character scalar, to choose between two implementation of the +subgraph calculation. \sQuote{\code{copy_and_delete}} copies the graph +first, and then deletes the vertices and edges that are not included in the +result graph. \sQuote{\code{create_from_scratch}} searches for all vertices +and edges that must be kept and then uses them to create the graph from +scratch. \sQuote{\code{auto}} chooses between the two implementations +automatically, using heuristics based on the size of the original and the +result graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{induced.subgraph()} was renamed to \code{induced_subgraph()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.connected.Rd b/man/is.connected.Rd new file mode 100644 index 00000000000..e3eefbdca17 --- /dev/null +++ b/man/is.connected.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.connected} +\alias{is.connected} +\title{Connected components of a graph} +\usage{ +is.connected(graph, mode = c("weak", "strong")) +} +\arguments{ +\item{graph}{The graph to analyze.} + +\item{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.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.connected()} was renamed to \code{is_connected()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.loop.Rd b/man/is.loop.Rd new file mode 100644 index 00000000000..0114c53b330 --- /dev/null +++ b/man/is.loop.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.loop} +\alias{is.loop} +\title{Find the multiple or loop edges in a graph} +\usage{ +is.loop(graph, eids = E(graph)) +} +\arguments{ +\item{graph}{The input graph.} + +\item{eids}{The edges to which the query is restricted. By default this is +all edges in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.loop()} was renamed to \code{which_loop()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.matching.Rd b/man/is.matching.Rd new file mode 100644 index 00000000000..5e40ababaa8 --- /dev/null +++ b/man/is.matching.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.matching} +\alias{is.matching} +\title{Matching} +\usage{ +is.matching(graph, matching, types = NULL) +} +\arguments{ +\item{graph}{The input graph. It might be directed, but edge directions will +be ignored.} + +\item{matching}{A potential matching. An integer vector that gives the +pair in the matching for each vertex. For vertices without a pair, +supply \code{NA} here.} + +\item{types}{Vertex types, if the graph is bipartite. By default they +are taken from the \sQuote{\code{type}} vertex attribute, if present.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.matching()} was renamed to \code{is_matching()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.maximal.matching.Rd b/man/is.maximal.matching.Rd new file mode 100644 index 00000000000..23ae1a509e7 --- /dev/null +++ b/man/is.maximal.matching.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.maximal.matching} +\alias{is.maximal.matching} +\title{Matching} +\usage{ +is.maximal.matching(graph, matching, types = NULL) +} +\arguments{ +\item{graph}{The input graph. It might be directed, but edge directions will +be ignored.} + +\item{matching}{A potential matching. An integer vector that gives the +pair in the matching for each vertex. For vertices without a pair, +supply \code{NA} here.} + +\item{types}{Vertex types, if the graph is bipartite. By default they +are taken from the \sQuote{\code{type}} vertex attribute, if present.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.maximal.matching()} was renamed to \code{is_max_matching()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.multiple.Rd b/man/is.multiple.Rd new file mode 100644 index 00000000000..63b813f50a0 --- /dev/null +++ b/man/is.multiple.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.multiple} +\alias{is.multiple} +\title{Find the multiple or loop edges in a graph} +\usage{ +is.multiple(graph, eids = E(graph)) +} +\arguments{ +\item{graph}{The input graph.} + +\item{eids}{The edges to which the query is restricted. By default this is +all edges in the graph.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.multiple()} was renamed to \code{which_multiple()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/is.mutual.Rd b/man/is.mutual.Rd new file mode 100644 index 00000000000..12f097e7872 --- /dev/null +++ b/man/is.mutual.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{is.mutual} +\alias{is.mutual} +\title{Find mutual edges in a directed graph} +\usage{ +is.mutual(graph, eids = E(graph)) +} +\arguments{ +\item{graph}{The input graph.} + +\item{eids}{Edge sequence, the edges that will be probed. By default is +includes all edges in the order of their ids.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{is.mutual()} was renamed to \code{which_mutual()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/knn.Rd b/man/knn.Rd index e7e4c93d4c4..e3c1d935cba 100644 --- a/man/knn.Rd +++ b/man/knn.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{knn} \alias{knn} -\alias{graph.knn} \title{Average nearest neighbor degree} \usage{ knn( diff --git a/man/laplacian_matrix.Rd b/man/laplacian_matrix.Rd index a6b85082cbb..80eb155615d 100644 --- a/man/laplacian_matrix.Rd +++ b/man/laplacian_matrix.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{laplacian_matrix} \alias{laplacian_matrix} -\alias{graph.laplacian} \title{Graph Laplacian} \usage{ laplacian_matrix( diff --git a/man/matching.Rd b/man/matching.Rd index 634e3f1ea52..4787dd1bf17 100644 --- a/man/matching.Rd +++ b/man/matching.Rd @@ -2,9 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{is_matching} \alias{is_matching} -\alias{is.matching} -\alias{is.maximal.matching} -\alias{maximum.bipartite.matching} \alias{max_bipartite_match} \alias{is_max_matching} \title{Matching} diff --git a/man/maximum.bipartite.matching.Rd b/man/maximum.bipartite.matching.Rd new file mode 100644 index 00000000000..d67e481d105 --- /dev/null +++ b/man/maximum.bipartite.matching.Rd @@ -0,0 +1,41 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{maximum.bipartite.matching} +\alias{maximum.bipartite.matching} +\title{Matching} +\usage{ +maximum.bipartite.matching( + graph, + types = NULL, + weights = NULL, + eps = .Machine$double.eps +) +} +\arguments{ +\item{graph}{The input graph. It might be directed, but edge directions will +be ignored.} + +\item{types}{Vertex types, if the graph is bipartite. By default they +are taken from the \sQuote{\code{type}} vertex attribute, if present.} + +\item{weights}{Potential edge weights. If the graph has an edge +attribute called \sQuote{\code{weight}}, and this argument is +\code{NULL}, then the edge attribute is used automatically. +In weighted matching, the weights of the edges must match as +much as possible.} + +\item{eps}{A small real number used in equality tests in the weighted +bipartite matching algorithm. Two real numbers are considered equal in +the algorithm if their difference is smaller than \code{eps}. This is +required to avoid the accumulation of numerical errors. By default it is +set to the smallest \eqn{x}, such that \eqn{1+x \ne 1}{1+x != 1} +holds. If you are running the algorithm with no weights, this argument +is ignored.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{maximum.bipartite.matching()} was renamed to \code{max_bipartite_match()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/neighborhood.size.Rd b/man/neighborhood.size.Rd new file mode 100644 index 00000000000..df5a6bd08a2 --- /dev/null +++ b/man/neighborhood.size.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{neighborhood.size} +\alias{neighborhood.size} +\title{Neighborhood of graph vertices} +\usage{ +neighborhood.size( + graph, + order = 1, + nodes = V(graph), + mode = c("all", "out", "in"), + mindist = 0 +) +} +\arguments{ +\item{graph}{The input graph.} + +\item{order}{Integer giving the order of the neighborhood.} + +\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 +vertex in at most \code{order} steps are counted. For \sQuote{"in"} all +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{mindist}{The minimum distance to include the vertex in the result.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{neighborhood.size()} was renamed to \code{ego_size()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/shortest.paths.Rd b/man/shortest.paths.Rd new file mode 100644 index 00000000000..40394f4051a --- /dev/null +++ b/man/shortest.paths.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{shortest.paths} +\alias{shortest.paths} +\title{Shortest (directed or undirected) paths between vertices} +\usage{ +shortest.paths( + graph, + v = V(graph), + to = V(graph), + mode = c("all", "out", "in"), + weights = NULL, + algorithm = c("automatic", "unweighted", "dijkstra", "bellman-ford", "johnson") +) +} +\arguments{ +\item{graph}{The graph to work on.} + +\item{v}{Numeric vector, the vertices from which the shortest paths will be +calculated.} + +\item{to}{Numeric vector, the vertices to which the shortest paths will be +calculated. By default it includes all vertices. Note that for +\code{distances()} every vertex must be included here at most once. (This +is not required for \code{shortest_paths()}.} + +\item{mode}{Character constant, gives whether the shortest paths to or from +the given vertices should be calculated for directed graphs. If \code{out} +then the shortest paths \emph{from} the vertex, if \verb{in} then \emph{to} +it will be considered. If \code{all}, the default, then the corresponding +undirected graph will be used, i.e. not directed paths are searched. This +argument is ignored for undirected graphs.} + +\item{weights}{Possibly a numeric vector giving edge weights. If this is +\code{NULL} and the graph has a \code{weight} edge attribute, then the +attribute is used. If this is \code{NA} then no weights are used (even if +the graph has a \code{weight} attribute).} + +\item{algorithm}{Which algorithm to use for the calculation. By default +igraph tries to select the fastest suitable algorithm. If there are no +weights, then an unweighted breadth-first search is used, otherwise if all +weights are positive, then Dijkstra's algorithm is used. If there are +negative weights and we do the calculation for more than 100 sources, then +Johnson's algorithm is used. Otherwise the Bellman-Ford algorithm is used. +You can override igraph's choice by explicitly giving this parameter. Note +that the igraph C core might still override your choice in obvious cases, +i.e. if there are no edge weights, then the unweighted algorithm will be +used, regardless of this argument.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{shortest.paths()} was renamed to \code{distances()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/subgraph.Rd b/man/subgraph.Rd index c60fb3f26ba..4afd0f7fc95 100644 --- a/man/subgraph.Rd +++ b/man/subgraph.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{subgraph} \alias{subgraph} -\alias{induced.subgraph} \alias{subgraph.edges} \alias{induced_subgraph} \title{Subgraph of a graph} diff --git a/man/topo_sort.Rd b/man/topo_sort.Rd index 9bf97c3fa5e..db5dcd5cd88 100644 --- a/man/topo_sort.Rd +++ b/man/topo_sort.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{topo_sort} \alias{topo_sort} -\alias{topological.sort} \title{Topological sorting of vertices in a graph} \usage{ topo_sort(graph, mode = c("out", "all", "in")) diff --git a/man/topological.sort.Rd b/man/topological.sort.Rd new file mode 100644 index 00000000000..fc2e4a64701 --- /dev/null +++ b/man/topological.sort.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{topological.sort} +\alias{topological.sort} +\title{Topological sorting of vertices in a graph} +\usage{ +topological.sort(graph, mode = c("out", "all", "in")) +} +\arguments{ +\item{graph}{The input graph, should be directed} + +\item{mode}{Specifies how to use the direction of the edges. For +\dQuote{\code{out}}, the sorting order ensures that each node comes before +all nodes to which it has edges, so nodes with no incoming edges go first. +For \dQuote{\verb{in}}, it is quite the opposite: each node comes before all +nodes from which it receives edges. Nodes with no outgoing edges go first.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{topological.sort()} was renamed to \code{topo_sort()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/unfold.tree.Rd b/man/unfold.tree.Rd new file mode 100644 index 00000000000..7675f402c61 --- /dev/null +++ b/man/unfold.tree.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structural.properties.R +\name{unfold.tree} +\alias{unfold.tree} +\title{Convert a general graph into a forest} +\usage{ +unfold.tree(graph, mode = c("all", "out", "in", "total"), roots) +} +\arguments{ +\item{graph}{The input graph, it can be either directed or undirected.} + +\item{mode}{Character string, defined the types of the paths used for the +breadth-first search. \dQuote{out} follows the outgoing, \dQuote{in} the +incoming edges, \dQuote{all} and \dQuote{total} both of them. This argument +is ignored for undirected graphs.} + +\item{roots}{A vector giving the vertices from which the breadth-first +search is performed. Typically it contains one vertex per component.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{unfold.tree()} was renamed to \code{unfold_tree()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/unfold_tree.Rd b/man/unfold_tree.Rd index 78b1fd5fd7a..515b91a95c9 100644 --- a/man/unfold_tree.Rd +++ b/man/unfold_tree.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{unfold_tree} \alias{unfold_tree} -\alias{unfold.tree} \title{Convert a general graph into a forest} \usage{ unfold_tree(graph, mode = c("all", "out", "in", "total"), roots) diff --git a/man/which_multiple.Rd b/man/which_multiple.Rd index d2da0f5a3e9..14f9141dada 100644 --- a/man/which_multiple.Rd +++ b/man/which_multiple.Rd @@ -2,10 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{which_multiple} \alias{which_multiple} -\alias{has.multiple} -\alias{is.loop} -\alias{is.multiple} -\alias{count.multiple} \alias{any_multiple} \alias{count_multiple} \alias{which_loop} diff --git a/man/which_mutual.Rd b/man/which_mutual.Rd index 866184c56e9..4b604fc10bd 100644 --- a/man/which_mutual.Rd +++ b/man/which_mutual.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structural.properties.R \name{which_mutual} \alias{which_mutual} -\alias{is.mutual} \title{Find mutual edges in a directed graph} \usage{ which_mutual(graph, eids = E(graph)) From 924bbe139bcf0614c91f1a4b2cba1a658a995044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:14:03 +0100 Subject: [PATCH 43/48] refactor!: change R/structure.info.R --- R/structure.info.R | 17 +++++++++++++++-- man/are.connected.Rd | 22 ++++++++++++++++++++++ man/are_adjacent.Rd | 1 - 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 man/are.connected.Rd diff --git a/R/structure.info.R b/R/structure.info.R index 71bfe5ddc08..63ffdbdf4d2 100644 --- a/R/structure.info.R +++ b/R/structure.info.R @@ -1,4 +1,19 @@ +#' Are two vertices adjacent? +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `are.connected()` was renamed to `are_adjacent()` to create a more +#' consistent API. +#' @inheritParams are_adjacent +#' @keywords internal +#' @export +are.connected <- function(graph , v1 , v2) { # nocov start + lifecycle::deprecate_soft("1.6.0", "are.connected()", "are_adjacent()") + are_adjacent(graph = graph, v1 = v1, v2 = v2) +} # nocov end + # IGraph R package # Copyright (C) 2005-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -25,7 +40,6 @@ #' The order of the vertices only matters in directed graphs, #' where the existence of a directed `(v1, v2)` edge is queried. #' -#' @aliases are.connected #' @param graph The graph. #' @param v1 The first vertex, tail in directed graphs. #' @param v2 The second vertex, head in directed graphs. @@ -55,4 +69,3 @@ are_adjacent <- function(graph, v1, v2) { ) } #' @export are.connected -deprecated("are.connected", are_adjacent) diff --git a/man/are.connected.Rd b/man/are.connected.Rd new file mode 100644 index 00000000000..00a5544ad5b --- /dev/null +++ b/man/are.connected.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/structure.info.R +\name{are.connected} +\alias{are.connected} +\title{Are two vertices adjacent?} +\usage{ +are.connected(graph, v1, v2) +} +\arguments{ +\item{graph}{The graph.} + +\item{v1}{The first vertex, tail in directed graphs.} + +\item{v2}{The second vertex, head in directed graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{are.connected()} was renamed to \code{are_adjacent()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/are_adjacent.Rd b/man/are_adjacent.Rd index 3059b409776..f9c4b6c1545 100644 --- a/man/are_adjacent.Rd +++ b/man/are_adjacent.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/structure.info.R \name{are_adjacent} \alias{are_adjacent} -\alias{are.connected} \title{Are two vertices adjacent?} \usage{ are_adjacent(graph, v1, v2) From 5188e368aa21cfb4416df3c10929bd0ea7b9ede8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:14:43 +0100 Subject: [PATCH 44/48] refactor!: change R/test.R --- R/test.R | 35 ++++++++++++++++++++++++++++++----- man/igraph.version.Rd | 15 +++++++++++++++ man/igraph_test.Rd | 1 - man/igraph_version.Rd | 1 - man/igraphtest.Rd | 15 +++++++++++++++ 5 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 man/igraph.version.Rd create mode 100644 man/igraphtest.Rd diff --git a/R/test.R b/R/test.R index a9938f7ee6a..5d34cf48fa3 100644 --- a/R/test.R +++ b/R/test.R @@ -1,3 +1,33 @@ + +#' Run package tests +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraphtest()` was renamed to `igraph_test()` to create a more +#' consistent API. +#' +#' @keywords internal +#' @export +igraphtest <- function() { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraphtest()", "igraph_test()") + igraph_test() +} # nocov end + +#' Query igraph's version string +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `igraph.version()` was renamed to `igraph_version()` to create a more +#' consistent API. +#' +#' @keywords internal +#' @export +igraph.version <- function() { # nocov start + lifecycle::deprecate_soft("1.6.0", "igraph.version()", "igraph_version()") + igraph_version() +} # nocov end # IGraph R package # Copyright (C) 2005-2013 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -32,7 +62,6 @@ #' This function simply calls the `test_dir` function from the #' `testthat` package on the test directory. #' -#' @aliases igraphtest #' @return Whatever is returned by `test_dir` from the `testthat` #' package. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} @@ -54,7 +83,6 @@ igraph_test <- function() { #' #' The igraph version string is always the same as the version of the R package. #' -#' @aliases igraph.version #' @return A character scalar, the igraph version string. #' @author Gabor Csardi \email{csardi.gabor@@gmail.com} #' @keywords graphs @@ -76,6 +104,3 @@ checkpkg <- function(package_file, args = character()) { do.call(":::", list("tools", ".check_packages"))(c(package_file, args)) } #' @export igraph.version -deprecated("igraph.version", igraph_version) -#' @export igraphtest -deprecated("igraphtest", igraph_test) diff --git a/man/igraph.version.Rd b/man/igraph.version.Rd new file mode 100644 index 00000000000..672971579b7 --- /dev/null +++ b/man/igraph.version.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/test.R +\name{igraph.version} +\alias{igraph.version} +\title{Query igraph's version string} +\usage{ +igraph.version() +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraph.version()} was renamed to \code{igraph_version()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/igraph_test.Rd b/man/igraph_test.Rd index 0dbfcb98c9c..e3c3bb08a2c 100644 --- a/man/igraph_test.Rd +++ b/man/igraph_test.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/test.R \name{igraph_test} \alias{igraph_test} -\alias{igraphtest} \title{Run package tests} \usage{ igraph_test() diff --git a/man/igraph_version.Rd b/man/igraph_version.Rd index 352814e5705..66d3a766239 100644 --- a/man/igraph_version.Rd +++ b/man/igraph_version.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/test.R \name{igraph_version} \alias{igraph_version} -\alias{igraph.version} \title{Query igraph's version string} \usage{ igraph_version() diff --git a/man/igraphtest.Rd b/man/igraphtest.Rd new file mode 100644 index 00000000000..e9d2c666071 --- /dev/null +++ b/man/igraphtest.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/test.R +\name{igraphtest} +\alias{igraphtest} +\title{Run package tests} +\usage{ +igraphtest() +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{igraphtest()} was renamed to \code{igraph_test()} to create a more +consistent API. +} +\keyword{internal} From 7e80d973fa1042474066206092e7951532cb7d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:15:23 +0100 Subject: [PATCH 45/48] refactor!: change R/tkplot.R --- R/tkplot.R | 171 ++++++++++++++++++++++++++++---- man/tkplot.Rd | 12 +-- man/tkplot.canvas.Rd | 18 ++++ man/tkplot.center.Rd | 18 ++++ man/tkplot.close.Rd | 20 ++++ man/tkplot.export.postscript.Rd | 18 ++++ man/tkplot.fit.to.screen.Rd | 22 ++++ man/tkplot.getcoords.Rd | 20 ++++ man/tkplot.off.Rd | 15 +++ man/tkplot.reshape.Rd | 25 +++++ man/tkplot.rotate.Rd | 22 ++++ man/tkplot.setcoords.Rd | 21 ++++ 12 files changed, 351 insertions(+), 31 deletions(-) create mode 100644 man/tkplot.canvas.Rd create mode 100644 man/tkplot.center.Rd create mode 100644 man/tkplot.close.Rd create mode 100644 man/tkplot.export.postscript.Rd create mode 100644 man/tkplot.fit.to.screen.Rd create mode 100644 man/tkplot.getcoords.Rd create mode 100644 man/tkplot.off.Rd create mode 100644 man/tkplot.reshape.Rd create mode 100644 man/tkplot.rotate.Rd create mode 100644 man/tkplot.setcoords.Rd diff --git a/R/tkplot.R b/R/tkplot.R index 118e57cce1b..8014e85c6c5 100644 --- a/R/tkplot.R +++ b/R/tkplot.R @@ -1,3 +1,153 @@ + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.setcoords()` was renamed to `tk_set_coords()` to create a more +#' consistent API. +#' @inheritParams tk_set_coords +#' @keywords internal +#' @export +tkplot.setcoords <- function(tkp.id , coords) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.setcoords()", "tk_set_coords()") + tk_set_coords(tkp.id = tkp.id, coords = coords) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.rotate()` was renamed to `tk_rotate()` to create a more +#' consistent API. +#' @inheritParams tk_rotate +#' @keywords internal +#' @export +tkplot.rotate <- function(tkp.id , degree = NULL , rad = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.rotate()", "tk_rotate()") + tk_rotate(tkp.id = tkp.id, degree = degree, rad = rad) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.reshape()` was renamed to `tk_reshape()` to create a more +#' consistent API. +#' @inheritParams tk_reshape +#' @keywords internal +#' @export +tkplot.reshape <- function(tkp.id , newlayout , ... , params) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.reshape()", "tk_reshape()") + tk_reshape(tkp.id = tkp.id, newlayout = newlayout, params = params, ...) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.off()` was renamed to `tk_off()` to create a more +#' consistent API. +#' +#' @keywords internal +#' @export +tkplot.off <- function() { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.off()", "tk_off()") + tk_off() +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.getcoords()` was renamed to `tk_coords()` to create a more +#' consistent API. +#' @inheritParams tk_coords +#' @keywords internal +#' @export +tkplot.getcoords <- function(tkp.id , norm = FALSE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.getcoords()", "tk_coords()") + tk_coords(tkp.id = tkp.id, norm = norm) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.fit.to.screen()` was renamed to `tk_fit()` to create a more +#' consistent API. +#' @inheritParams tk_fit +#' @keywords internal +#' @export +tkplot.fit.to.screen <- function(tkp.id , width = NULL , height = NULL) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.fit.to.screen()", "tk_fit()") + tk_fit(tkp.id = tkp.id, width = width, height = height) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.export.postscript()` was renamed to `tk_postscript()` to create a more +#' consistent API. +#' @inheritParams tk_postscript +#' @keywords internal +#' @export +tkplot.export.postscript <- function(tkp.id) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.export.postscript()", "tk_postscript()") + tk_postscript(tkp.id = tkp.id) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.close()` was renamed to `tk_close()` to create a more +#' consistent API. +#' @inheritParams tk_close +#' @keywords internal +#' @export +tkplot.close <- function(tkp.id , window.close = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.close()", "tk_close()") + tk_close(tkp.id = tkp.id, window.close = window.close) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.center()` was renamed to `tk_center()` to create a more +#' consistent API. +#' @inheritParams tk_center +#' @keywords internal +#' @export +tkplot.center <- function(tkp.id) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.center()", "tk_center()") + tk_center(tkp.id = tkp.id) +} # nocov end + +#' Interactive plotting of graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `tkplot.canvas()` was renamed to `tk_canvas()` to create a more +#' consistent API. +#' @inheritParams tk_canvas +#' @keywords internal +#' @export +tkplot.canvas <- function(tkp.id) { # nocov start + lifecycle::deprecate_soft("1.6.0", "tkplot.canvas()", "tk_canvas()") + tk_canvas(tkp.id = tkp.id) +} # nocov end # IGraph R package # Copyright (C) 2003-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -101,8 +251,6 @@ assign(".next", 1, .tkplot.env) #' `tk_rotate()` rotates the figure, its parameter can be given either #' in degrees or in radians. #' -#' @aliases tkplot.close tkplot.off tkplot.fit.to.screen tkplot.reshape -#' tkplot.export.postscript tkplot.canvas tkplot.getcoords tkplot.setcoords #' tkplot.center tkplot.rotate #' @param graph The `graph` to plot. #' @param canvas.width,canvas.height The size of the tkplot drawing area. @@ -1832,22 +1980,3 @@ i.tkplot.get.edge.lty <- function(edge.lty) { edge.lty } #' @export tkplot.canvas -deprecated("tkplot.canvas", tk_canvas) -#' @export tkplot.center -deprecated("tkplot.center", tk_center) -#' @export tkplot.close -deprecated("tkplot.close", tk_close) -#' @export tkplot.export.postscript -deprecated("tkplot.export.postscript", tk_postscript) -#' @export tkplot.fit.to.screen -deprecated("tkplot.fit.to.screen", tk_fit) -#' @export tkplot.getcoords -deprecated("tkplot.getcoords", tk_coords) -#' @export tkplot.off -deprecated("tkplot.off", tk_off) -#' @export tkplot.reshape -deprecated("tkplot.reshape", tk_reshape) -#' @export tkplot.rotate -deprecated("tkplot.rotate", tk_rotate) -#' @export tkplot.setcoords -deprecated("tkplot.setcoords", tk_set_coords) diff --git a/man/tkplot.Rd b/man/tkplot.Rd index 36139112173..4ae97c0f87f 100644 --- a/man/tkplot.Rd +++ b/man/tkplot.Rd @@ -2,16 +2,6 @@ % Please edit documentation in R/tkplot.R \name{tkplot} \alias{tkplot} -\alias{tkplot.close} -\alias{tkplot.off} -\alias{tkplot.fit.to.screen} -\alias{tkplot.reshape} -\alias{tkplot.export.postscript} -\alias{tkplot.canvas} -\alias{tkplot.getcoords} -\alias{tkplot.setcoords} -\alias{tkplot.center} -\alias{tkplot.rotate} \alias{tk_close} \alias{tk_off} \alias{tk_fit} @@ -154,6 +144,8 @@ vertex. \code{tk_rotate()} rotates the figure, its parameter can be given either in degrees or in radians. + +tkplot.center tkplot.rotate } \section{Examples}{ diff --git a/man/tkplot.canvas.Rd b/man/tkplot.canvas.Rd new file mode 100644 index 00000000000..f8b133b1750 --- /dev/null +++ b/man/tkplot.canvas.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.canvas} +\alias{tkplot.canvas} +\title{Interactive plotting of graphs} +\usage{ +tkplot.canvas(tkp.id) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.canvas()} was renamed to \code{tk_canvas()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.center.Rd b/man/tkplot.center.Rd new file mode 100644 index 00000000000..65bed3a600e --- /dev/null +++ b/man/tkplot.center.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.center} +\alias{tkplot.center} +\title{Interactive plotting of graphs} +\usage{ +tkplot.center(tkp.id) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.center()} was renamed to \code{tk_center()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.close.Rd b/man/tkplot.close.Rd new file mode 100644 index 00000000000..a8caffb03e7 --- /dev/null +++ b/man/tkplot.close.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.close} +\alias{tkplot.close} +\title{Interactive plotting of graphs} +\usage{ +tkplot.close(tkp.id, window.close = TRUE) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\item{window.close}{Leave this on the default value.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.close()} was renamed to \code{tk_close()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.export.postscript.Rd b/man/tkplot.export.postscript.Rd new file mode 100644 index 00000000000..7b507d049c2 --- /dev/null +++ b/man/tkplot.export.postscript.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.export.postscript} +\alias{tkplot.export.postscript} +\title{Interactive plotting of graphs} +\usage{ +tkplot.export.postscript(tkp.id) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.export.postscript()} was renamed to \code{tk_postscript()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.fit.to.screen.Rd b/man/tkplot.fit.to.screen.Rd new file mode 100644 index 00000000000..890c21acacf --- /dev/null +++ b/man/tkplot.fit.to.screen.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.fit.to.screen} +\alias{tkplot.fit.to.screen} +\title{Interactive plotting of graphs} +\usage{ +tkplot.fit.to.screen(tkp.id, width = NULL, height = NULL) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\item{width}{The width of the rectangle for generating new coordinates.} + +\item{height}{The height of the rectangle for generating new coordinates.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.fit.to.screen()} was renamed to \code{tk_fit()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.getcoords.Rd b/man/tkplot.getcoords.Rd new file mode 100644 index 00000000000..764eaa37184 --- /dev/null +++ b/man/tkplot.getcoords.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.getcoords} +\alias{tkplot.getcoords} +\title{Interactive plotting of graphs} +\usage{ +tkplot.getcoords(tkp.id, norm = FALSE) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\item{norm}{Logical, should we norm the coordinates.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.getcoords()} was renamed to \code{tk_coords()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.off.Rd b/man/tkplot.off.Rd new file mode 100644 index 00000000000..af466411dbf --- /dev/null +++ b/man/tkplot.off.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.off} +\alias{tkplot.off} +\title{Interactive plotting of graphs} +\usage{ +tkplot.off() +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.off()} was renamed to \code{tk_off()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.reshape.Rd b/man/tkplot.reshape.Rd new file mode 100644 index 00000000000..00720067f46 --- /dev/null +++ b/man/tkplot.reshape.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.reshape} +\alias{tkplot.reshape} +\title{Interactive plotting of graphs} +\usage{ +tkplot.reshape(tkp.id, newlayout, ..., params) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\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{params}{Extra parameters in a list, to pass to the layout function.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.reshape()} was renamed to \code{tk_reshape()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.rotate.Rd b/man/tkplot.rotate.Rd new file mode 100644 index 00000000000..229bb59db4c --- /dev/null +++ b/man/tkplot.rotate.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.rotate} +\alias{tkplot.rotate} +\title{Interactive plotting of graphs} +\usage{ +tkplot.rotate(tkp.id, degree = NULL, rad = NULL) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\item{degree}{The degree to rotate the plot.} + +\item{rad}{The degree to rotate the plot, in radian.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.rotate()} was renamed to \code{tk_rotate()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/tkplot.setcoords.Rd b/man/tkplot.setcoords.Rd new file mode 100644 index 00000000000..f3004ecf881 --- /dev/null +++ b/man/tkplot.setcoords.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tkplot.R +\name{tkplot.setcoords} +\alias{tkplot.setcoords} +\title{Interactive plotting of graphs} +\usage{ +tkplot.setcoords(tkp.id, coords) +} +\arguments{ +\item{tkp.id}{The id of the tkplot window to close/reshape/etc.} + +\item{coords}{Two-column numeric matrix, the new coordinates of the +vertices, in absolute coordinates.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{tkplot.setcoords()} was renamed to \code{tk_set_coords()} to create a more +consistent API. +} +\keyword{internal} From d01bcce16a0fd7d237370e23afc78f4c918f9775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:16:07 +0100 Subject: [PATCH 46/48] refactor!: change R/topology.R --- R/topology.R | 90 ++++++++++++++++++++++++----- man/automorphisms.Rd | 33 +++++++++++ man/canonical.permutation.Rd | 32 ++++++++++ man/canonical_permutation.Rd | 1 - man/count_automorphisms.Rd | 2 - man/graph.automorphisms.Rd | 33 +++++++++++ man/graph.isocreate.Rd | 22 +++++++ man/graph_from_isomorphism_class.Rd | 1 - man/permute.Rd | 1 - man/permute.vertices.Rd | 22 +++++++ 10 files changed, 218 insertions(+), 19 deletions(-) create mode 100644 man/automorphisms.Rd create mode 100644 man/canonical.permutation.Rd create mode 100644 man/graph.automorphisms.Rd create mode 100644 man/graph.isocreate.Rd create mode 100644 man/permute.vertices.Rd diff --git a/R/topology.R b/R/topology.R index 628c9e0d185..829ce3d465b 100644 --- a/R/topology.R +++ b/R/topology.R @@ -1,4 +1,79 @@ +#' Permute the vertices of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `permute.vertices()` was renamed to `permute()` to create a more +#' consistent API. +#' @inheritParams permute +#' @keywords internal +#' @export +permute.vertices <- function(graph , permutation) { # nocov start + lifecycle::deprecate_soft("1.6.0", "permute.vertices()", "permute()") + permute(graph = graph, permutation = permutation) +} # nocov end + +#' Create a graph from an isomorphism class +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.isocreate()` was renamed to `graph_from_isomorphism_class()` to create a more +#' consistent API. +#' @inheritParams graph_from_isomorphism_class +#' @keywords internal +#' @export +graph.isocreate <- function(size , number , directed = TRUE) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.isocreate()", "graph_from_isomorphism_class()") + graph_from_isomorphism_class(size = size, number = number, directed = directed) +} # nocov end + +#' Number of automorphisms +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `graph.automorphisms()` was renamed to `count_automorphisms()` to create a more +#' consistent API. +#' @inheritParams count_automorphisms +#' @keywords internal +#' @export +graph.automorphisms <- function(graph , colors , sh = c("fm","f","fs","fl","flm","fsm")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "graph.automorphisms()", "count_automorphisms()") + count_automorphisms(graph = graph, colors = colors, sh = sh) +} # nocov end + +#' Canonical permutation of a graph +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `canonical.permutation()` was renamed to `canonical_permutation()` to create a more +#' consistent API. +#' @inheritParams canonical_permutation +#' @keywords internal +#' @export +canonical.permutation <- function(graph , colors , sh = c("fm","f","fs","fl","flm","fsm")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "canonical.permutation()", "canonical_permutation()") + canonical_permutation(graph = graph, colors = colors, sh = sh) +} # nocov end + +#' Number of automorphisms +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `automorphisms()` was renamed to `count_automorphisms()` to create a more +#' consistent API. +#' @inheritParams count_automorphisms +#' @keywords internal +#' @export +automorphisms <- function(graph , colors , sh = c("fm","f","fs","fl","flm","fsm")) { # nocov start + lifecycle::deprecate_soft("1.6.0", "automorphisms()", "count_automorphisms()") + count_automorphisms(graph = graph, colors = colors, sh = sh) +} # nocov end + # IGraph R package # Copyright (C) 2006-2012 Gabor Csardi # 334 Harvard street, Cambridge, MA 02139 USA @@ -255,7 +330,7 @@ graph.subisomorphic.lad <- function(pattern, target, domains = NULL, #' @return Logical scalar, `TRUE` if the graphs are isomorphic. #' #' @aliases graph.isomorphic graph.isomorphic.34 graph.isomorphic.vf2 -#' graph.isomorphic.bliss +#' @aliases graph.isomorphic.bliss #' #' @references #' Tommi Junttila and Petteri Kaski: Engineering an Efficient Canonical @@ -697,7 +772,6 @@ graph.isoclass <- isoclass_impl #' @return An igraph object, the graph of the given size, directedness #' and isomorphism class. #' -#' @aliases graph.isocreate #' #' @family graph isomorphism #' @export @@ -725,7 +799,6 @@ graph_from_isomorphism_class <- isoclass_create_impl #' connected non-singleton cell.} } See the paper in references for details #' about these. #' -#' @aliases canonical.permutation #' @param graph The input graph, treated as undirected. #' @param colors The colors of the individual vertices of the graph; only #' vertices having the same color are allowed to match each other in an @@ -792,7 +865,6 @@ canonical_permutation <- canonical_permutation_impl #' #' `permute()` keeps all graph, vertex and edge attributes of the graph. #' -#' @aliases permute.vertices #' @param graph The input graph, it can directed or undirected. #' @param permutation A numeric vector giving the permutation to apply. The #' first element is the new id of vertex 1, etc. Every number between one and @@ -839,7 +911,6 @@ graph.isomorphic <- isomorphic_impl #' automorphisms themselves, use [automorphism_group()] to obtain #' a compact representation of the automorphism group. #' -#' @aliases graph.automorphisms automorphisms #' @param graph The input graph, it is treated as undirected. #' @param colors The colors of the individual vertices of the graph; only #' vertices having the same color are allowed to match each other in an @@ -946,12 +1017,3 @@ count_automorphisms <- automorphisms_impl #' @export automorphism_group <- automorphism_group_impl #' @export automorphisms -deprecated("automorphisms", count_automorphisms) -#' @export canonical.permutation -deprecated("canonical.permutation", canonical_permutation) -#' @export graph.automorphisms -deprecated("graph.automorphisms", count_automorphisms) -#' @export graph.isocreate -deprecated("graph.isocreate", graph_from_isomorphism_class) -#' @export permute.vertices -deprecated("permute.vertices", permute) diff --git a/man/automorphisms.Rd b/man/automorphisms.Rd new file mode 100644 index 00000000000..d1a777b6404 --- /dev/null +++ b/man/automorphisms.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/topology.R +\name{automorphisms} +\alias{automorphisms} +\title{Number of automorphisms} +\usage{ +automorphisms(graph, colors, sh = c("fm", "f", "fs", "fl", "flm", "fsm")) +} +\arguments{ +\item{graph}{The input graph, it is treated as undirected.} + +\item{colors}{The colors of the individual vertices of the graph; only +vertices having the same color are allowed to match each other in an +automorphism. When omitted, igraph uses the \code{color} attribute of the +vertices, or, if there is no such vertex attribute, it simply assumes that +all vertices have the same color. Pass NULL explicitly if the graph has a +\code{color} vertex attribute but you do not want to use it.} + +\item{sh}{The splitting heuristics for the BLISS algorithm. Possible values +are: \sQuote{\code{f}}: first non-singleton cell, \sQuote{\code{fl}}: first +largest non-singleton cell, \sQuote{\code{fs}}: first smallest non-singleton +cell, \sQuote{\code{fm}}: first maximally non-trivially connected +non-singleton cell, \sQuote{\code{flm}}: first largest maximally +non-trivially connected non-singleton cell, \sQuote{\code{fsm}}: first +smallest maximally non-trivially connected non-singleton cell.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{automorphisms()} was renamed to \code{count_automorphisms()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/canonical.permutation.Rd b/man/canonical.permutation.Rd new file mode 100644 index 00000000000..fd3deebd214 --- /dev/null +++ b/man/canonical.permutation.Rd @@ -0,0 +1,32 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/topology.R +\name{canonical.permutation} +\alias{canonical.permutation} +\title{Canonical permutation of a graph} +\usage{ +canonical.permutation( + graph, + colors, + sh = c("fm", "f", "fs", "fl", "flm", "fsm") +) +} +\arguments{ +\item{graph}{The input graph, treated as undirected.} + +\item{colors}{The colors of the individual vertices of the graph; only +vertices having the same color are allowed to match each other in an +automorphism. When omitted, igraph uses the \code{color} attribute of the +vertices, or, if there is no such vertex attribute, it simply assumes that +all vertices have the same color. Pass NULL explicitly if the graph has a +\code{color} vertex attribute but you do not want to use it.} + +\item{sh}{Type of the heuristics to use for the BLISS algorithm. See details +for possible values.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{canonical.permutation()} was renamed to \code{canonical_permutation()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/canonical_permutation.Rd b/man/canonical_permutation.Rd index 8d714e09918..fbb47451aaf 100644 --- a/man/canonical_permutation.Rd +++ b/man/canonical_permutation.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/topology.R \name{canonical_permutation} \alias{canonical_permutation} -\alias{canonical.permutation} \title{Canonical permutation of a graph} \usage{ canonical_permutation( diff --git a/man/count_automorphisms.Rd b/man/count_automorphisms.Rd index f980a2d8fea..fa5aab242a1 100644 --- a/man/count_automorphisms.Rd +++ b/man/count_automorphisms.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/topology.R \name{count_automorphisms} \alias{count_automorphisms} -\alias{graph.automorphisms} -\alias{automorphisms} \title{Number of automorphisms} \usage{ count_automorphisms(graph, colors, sh = c("fm", "f", "fs", "fl", "flm", "fsm")) diff --git a/man/graph.automorphisms.Rd b/man/graph.automorphisms.Rd new file mode 100644 index 00000000000..76d10508f74 --- /dev/null +++ b/man/graph.automorphisms.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/topology.R +\name{graph.automorphisms} +\alias{graph.automorphisms} +\title{Number of automorphisms} +\usage{ +graph.automorphisms(graph, colors, sh = c("fm", "f", "fs", "fl", "flm", "fsm")) +} +\arguments{ +\item{graph}{The input graph, it is treated as undirected.} + +\item{colors}{The colors of the individual vertices of the graph; only +vertices having the same color are allowed to match each other in an +automorphism. When omitted, igraph uses the \code{color} attribute of the +vertices, or, if there is no such vertex attribute, it simply assumes that +all vertices have the same color. Pass NULL explicitly if the graph has a +\code{color} vertex attribute but you do not want to use it.} + +\item{sh}{The splitting heuristics for the BLISS algorithm. Possible values +are: \sQuote{\code{f}}: first non-singleton cell, \sQuote{\code{fl}}: first +largest non-singleton cell, \sQuote{\code{fs}}: first smallest non-singleton +cell, \sQuote{\code{fm}}: first maximally non-trivially connected +non-singleton cell, \sQuote{\code{flm}}: first largest maximally +non-trivially connected non-singleton cell, \sQuote{\code{fsm}}: first +smallest maximally non-trivially connected non-singleton cell.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.automorphisms()} was renamed to \code{count_automorphisms()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph.isocreate.Rd b/man/graph.isocreate.Rd new file mode 100644 index 00000000000..a1b02f4dccf --- /dev/null +++ b/man/graph.isocreate.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/topology.R +\name{graph.isocreate} +\alias{graph.isocreate} +\title{Create a graph from an isomorphism class} +\usage{ +graph.isocreate(size, number, directed = TRUE) +} +\arguments{ +\item{size}{The number of vertices in the graph.} + +\item{number}{The isomorphism class.} + +\item{directed}{Whether to create a directed graph (the default).} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{graph.isocreate()} was renamed to \code{graph_from_isomorphism_class()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/graph_from_isomorphism_class.Rd b/man/graph_from_isomorphism_class.Rd index df9b0f5a049..f6cad230fb7 100644 --- a/man/graph_from_isomorphism_class.Rd +++ b/man/graph_from_isomorphism_class.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/topology.R \name{graph_from_isomorphism_class} \alias{graph_from_isomorphism_class} -\alias{graph.isocreate} \title{Create a graph from an isomorphism class} \usage{ graph_from_isomorphism_class(size, number, directed = TRUE) diff --git a/man/permute.Rd b/man/permute.Rd index 55ab931dba9..663f8ad0224 100644 --- a/man/permute.Rd +++ b/man/permute.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/topology.R \name{permute} \alias{permute} -\alias{permute.vertices} \title{Permute the vertices of a graph} \usage{ permute(graph, permutation) diff --git a/man/permute.vertices.Rd b/man/permute.vertices.Rd new file mode 100644 index 00000000000..3c806fca4f6 --- /dev/null +++ b/man/permute.vertices.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/topology.R +\name{permute.vertices} +\alias{permute.vertices} +\title{Permute the vertices of a graph} +\usage{ +permute.vertices(graph, permutation) +} +\arguments{ +\item{graph}{The input graph, it can directed or undirected.} + +\item{permutation}{A numeric vector giving the permutation to apply. The +first element is the new id of vertex 1, etc. Every number between one and +\code{vcount(graph)} must appear exactly once.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{permute.vertices()} was renamed to \code{permute()} to create a more +consistent API. +} +\keyword{internal} From 6043e51a6f63ced2721905c822eca81c37034827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:16:43 +0100 Subject: [PATCH 47/48] refactor!: change R/triangles.R --- R/triangles.R | 18 ++++++++++++++++-- man/adjacent.triangles.Rd | 23 +++++++++++++++++++++++ man/count_triangles.Rd | 1 - 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 man/adjacent.triangles.Rd diff --git a/R/triangles.R b/R/triangles.R index 4dd3db85cef..4af7183da55 100644 --- a/R/triangles.R +++ b/R/triangles.R @@ -1,4 +1,19 @@ +#' Find triangles in graphs +#' +#' @description +#' `r lifecycle::badge("deprecated")` +#' +#' `adjacent.triangles()` was renamed to `count_triangles()` to create a more +#' consistent API. +#' @inheritParams count_triangles +#' @keywords internal +#' @export +adjacent.triangles <- function(graph , vids = V(graph)) { # nocov start + lifecycle::deprecate_soft("1.6.0", "adjacent.triangles()", "count_triangles()") + count_triangles(graph = graph, vids = vids) +} # nocov end + ## ----------------------------------------------------------------------- ## ## IGraph R package @@ -34,7 +49,7 @@ #' #' `count_triangles()` counts how many triangles a vertex is part of. #' -#' @aliases adjacent.triangles triangles +#' @aliases triangles #' @param graph The input graph. It might be directed, but edge directions are #' ignored. #' @param vids The vertices to query, all of them by default. This might be a @@ -76,4 +91,3 @@ triangles <- list_triangles_impl #' @rdname count_triangles count_triangles <- adjacent_triangles_impl #' @export adjacent.triangles -deprecated("adjacent.triangles", count_triangles) diff --git a/man/adjacent.triangles.Rd b/man/adjacent.triangles.Rd new file mode 100644 index 00000000000..4ad9cbae1b9 --- /dev/null +++ b/man/adjacent.triangles.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/triangles.R +\name{adjacent.triangles} +\alias{adjacent.triangles} +\title{Find triangles in graphs} +\usage{ +adjacent.triangles(graph, vids = V(graph)) +} +\arguments{ +\item{graph}{The input graph. It might be directed, but edge directions are +ignored.} + +\item{vids}{The vertices to query, all of them by default. This might be a +vector of numeric ids, or a character vector of symbolic vertex names for +named graphs.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} + +\code{adjacent.triangles()} was renamed to \code{count_triangles()} to create a more +consistent API. +} +\keyword{internal} diff --git a/man/count_triangles.Rd b/man/count_triangles.Rd index 9d4275a2a69..240968aafaf 100644 --- a/man/count_triangles.Rd +++ b/man/count_triangles.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/triangles.R \name{triangles} \alias{triangles} -\alias{adjacent.triangles} \alias{count_triangles} \title{Find triangles in graphs} \usage{ From d388a4aa794c0f24ac168dc699261272d6ff0d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Mon, 4 Dec 2023 15:17:28 +0100 Subject: [PATCH 48/48] refactor: remove deprecated() def --- NAMESPACE | 1 - R/aaa-a-deprecate.R | 29 ----------------------------- 2 files changed, 30 deletions(-) delete mode 100644 R/aaa-a-deprecate.R diff --git a/NAMESPACE b/NAMESPACE index 3ad0778d3fe..2237e9bca29 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -935,7 +935,6 @@ importFrom(utils,capture.output) importFrom(utils,edit) importFrom(utils,head) importFrom(utils,packageDescription) -importFrom(utils,packageName) importFrom(utils,read.table) importFrom(utils,setTxtProgressBar) importFrom(utils,tail) diff --git a/R/aaa-a-deprecate.R b/R/aaa-a-deprecate.R deleted file mode 100644 index d5bcc3846a9..00000000000 --- a/R/aaa-a-deprecate.R +++ /dev/null @@ -1,29 +0,0 @@ - -# IGraph R package -# Copyright (C) 2014 Gabor Csardi -# 334 Harvard street, Cambridge, MA 02139 USA -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA -# -################################################################### - -## For the future, right now, we do not warn or even message - -#' @importFrom utils packageName -deprecated <- function(old, new) { - assign(old, new, envir = asNamespace(packageName())) -} -