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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions R/adjacency.R
Original file line number Diff line number Diff line change
Expand Up @@ -405,17 +405,17 @@ graph_from_adjacency_matrix <- function(adjmatrix,
mode <- igraph.match.arg(mode)

if (!is.matrix(adjmatrix) && !inherits(adjmatrix, "Matrix")) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"graph_from_adjacency_matrix(adjmatrix = 'must be a matrix')"
)
adjmatrix <- as.matrix(1)
}

if (mode == "undirected") {
if (!is_symmetric(adjmatrix)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"graph_from_adjacency_matrix(adjmatrix = 'must be symmetric with mode = \"undirected\"')",
details = 'Use mode = "max" to achieve the original behavior.'
)
Expand Down
4 changes: 2 additions & 2 deletions R/as_phylo.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#' @inheritParams ape::as.phylo
#' @keywords internal
as_phylo <- function(x, ...) {
lifecycle::deprecate_soft(
"1.5.0",
lifecycle::deprecate_warn(
"2.0.0",
"ape::as.phylo()"
)
check_installed("ape", "for using `as.phylo()`")
Expand Down
12 changes: 6 additions & 6 deletions R/assortativity.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ assortativity <- function(graph,
types1 = NULL,
types2 = NULL) {
if (...length() > 0) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"assortativity(... =)",
details = "Arguments `values` and `values.in` must be named."
)
Expand All @@ -170,17 +170,17 @@ assortativity <- function(graph,
}

if (missing(values)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"assortativity(types1 =)",
"assortativity(values =)"
)
values <- types1
}

if (!is.null(types2)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"assortativity(types2 =)",
"assortativity(values.in =)"
)
Expand Down
32 changes: 16 additions & 16 deletions R/centrality.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ alpha.centrality <- function(graph, nodes = V(graph), alpha = 1, loops = FALSE,
#' @keywords internal
#' @export
estimate_betweenness <- function(graph, vids = V(graph), directed = TRUE, cutoff, weights = NULL) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"estimate_betweenness()",
"betweenness()",
details = "with the cutoff argument."
Expand Down Expand Up @@ -352,8 +352,8 @@ edge_betweenness <- function(graph, e = E(graph),
#' @export
estimate_edge_betweenness <- function(graph, e = E(graph),
directed = TRUE, cutoff, weights = NULL) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"estimate_edge_betweenness()",
"edge_betweenness()",
details = "with the cutoff argument."
Expand Down Expand Up @@ -468,8 +468,8 @@ closeness <- function(graph, vids = V(graph),
#' @export
estimate_closeness <- function(graph, vids = V(graph), mode = c("out", "in", "all", "total"), cutoff, weights = NULL, normalized = FALSE) {

lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"estimate_closeness()",
"closeness()",
details = "with the cutoff argument."
Expand Down Expand Up @@ -683,8 +683,8 @@ arpack <- function(func, extra = NULL, sym = FALSE, options = arpack_defaults(),
env = parent.frame(), complex = !sym) {

if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"arpack(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand Down Expand Up @@ -870,8 +870,8 @@ subgraph_centrality <- function(graph, diag = FALSE) {
#' @export
spectrum <- function(graph, algorithm=c("arpack", "auto", "lapack", "comp_auto", "comp_lapack", "comp_arpack"), which=list(), options=arpack_defaults()) {
if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"spectrum(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand Down Expand Up @@ -983,8 +983,8 @@ eigen_centrality <- function(graph,
options = arpack_defaults()) {

if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"eigen_centrality(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand Down Expand Up @@ -1135,8 +1135,8 @@ diversity <- diversity_impl
hub_score <- function(graph, scale=TRUE, weights=NULL, options=arpack_defaults()) {

if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"hub_score(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand All @@ -1155,8 +1155,8 @@ hub_score <- function(graph, scale=TRUE, weights=NULL, options=arpack_defaults()
#' @export
authority_score <- function(graph, scale=TRUE, weights=NULL, options=arpack_defaults()) {
if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
I("arpack_defaults"),
"arpack_defaults()",
details = c("So the function arpack_defaults(), not an object called arpack_defaults.")
Expand Down
8 changes: 4 additions & 4 deletions R/community.R
Original file line number Diff line number Diff line change
Expand Up @@ -1868,8 +1868,8 @@ cluster_leading_eigen <- function(graph, steps = -1, weights = NULL,
env = parent.frame()) {

if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"cluster_leading_eigen(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand Down Expand Up @@ -1986,8 +1986,8 @@ cluster_label_prop <- function(
initial = NULL,
fixed = NULL) {
if (...length() > 0) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"cluster_label_prop(... = )",
details = "Arguments `initial` and `fixed` must be named."
)
Expand Down
2 changes: 1 addition & 1 deletion R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ as_biadjacency_matrix <- function(graph, types = NULL, attr = NULL,
#' this naming to avoid confusion with the edge-vertex incidence matrix.
#' @export
as_incidence_matrix <- function(...) { # nocov start
lifecycle::deprecate_soft("1.6.0", "as_incidence_matrix()", "as_biadjacency_matrix()")
lifecycle::deprecate_warn("2.0.0", "as_incidence_matrix()", "as_biadjacency_matrix()")
as_biadjacency_matrix(...)
} # nocov end
#' @rdname graph_from_data_frame
Expand Down
4 changes: 2 additions & 2 deletions R/incidence.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ graph_from_biadjacency_matrix <- function(incidence, directed = FALSE,
#' this naming to avoid confusion with the edge-vertex incidence matrix.
#' @export
from_incidence_matrix <- function(...) { # nocov start
lifecycle::deprecate_soft("1.6.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()")
lifecycle::deprecate_warn("2.0.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()")
graph_from_biadjacency_matrix(...)
} # nocov end
#' From incidence matrix
Expand All @@ -295,6 +295,6 @@ from_incidence_matrix <- function(...) { # nocov start
#' this naming to avoid confusion with the edge-vertex incidence matrix.
#' @export
graph_from_incidence_matrix <- function(...) { # nocov start
lifecycle::deprecate_soft("1.6.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()")
lifecycle::deprecate_warn("2.0.0", "graph_from_incidence_matrix()", "graph_from_biadjacency_matrix()")
graph_from_biadjacency_matrix(...)
} # nocov end
4 changes: 2 additions & 2 deletions R/layout.R
Original file line number Diff line number Diff line change
Expand Up @@ -1687,8 +1687,8 @@ layout_with_mds <- function(graph, dist = NULL, dim = 2,
options = arpack_defaults()) {

if (is.function(options)) {
lifecycle::deprecate_soft(
"1.6.0",
lifecycle::deprecate_warn(
"2.0.0",
"layout_with_mds(options = 'must be a list')",
details = c("`arpack_defaults()` is now a function, use `options = arpack_defaults()` instead of `options = arpack_defaults`.")
)
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/_snaps/graph.adjacency.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
graph_from_adjacency_matrix(m, mode = "undirected")
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 2.0.0.
i Use mode = "max" to achieve the original behavior.
Output
IGRAPH U--- 2 2 --
Expand Down Expand Up @@ -53,7 +53,7 @@
graph_from_adjacency_matrix(m2, mode = "undirected")
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 2.0.0.
i Use mode = "max" to achieve the original behavior.
Output
IGRAPH U--- 2 0 --
Expand All @@ -62,7 +62,7 @@
graph_from_adjacency_matrix(1)
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 2.0.0.
Output
IGRAPH D--- 1 1 --
+ edge:
Expand All @@ -71,7 +71,7 @@
graph_from_adjacency_matrix(1, mode = "undirected")
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be a matrix as of igraph 2.0.0.
Output
IGRAPH U--- 1 1 --
+ edge:
Expand Down Expand Up @@ -101,7 +101,7 @@
graph_from_adjacency_matrix(m, mode = "undirected")
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 2.0.0.
i Use mode = "max" to achieve the original behavior.
Output
IGRAPH U--- 2 2 --
Expand Down Expand Up @@ -133,7 +133,7 @@
graph_from_adjacency_matrix(m2, mode = "undirected")
Condition
Warning:
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 1.6.0.
The `adjmatrix` argument of `graph_from_adjacency_matrix()` must be symmetric with mode = "undirected" as of igraph 2.0.0.
i Use mode = "max" to achieve the original behavior.
Output
IGRAPH U--- 2 0 --
Expand Down