diff --git a/DESCRIPTION b/DESCRIPTION index 56805490..87b082b7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: manynet Title: Many Ways to Make, Modify, Map, Mark, and Measure Myriad Networks -Version: 1.2.5 +Version: 1.2.6 Date: 2024-10-05 Description: Many tools for making, modifying, mapping, marking, measuring, and motifs and memberships of many different types of networks. diff --git a/NEWS.md b/NEWS.md index b0e744ad..e4da3e59 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# manynet 1.2.6 + +## Package + +- Fixed errors when testing without `{concaveman}` +- Fixed errors when plotting some examples without `{ggdendro}` + # manynet 1.2.5 ## Package diff --git a/R/member_community.R b/R/member_community.R index 6460eb1a..691ed248 100644 --- a/R/member_community.R +++ b/R/member_community.R @@ -308,7 +308,9 @@ NULL #' \doi{10.1103/PhysRevE.69.026113} #' @examples #' node_in_betweenness(ison_adolescents) +#' if(require("ggdendro", quietly = TRUE)){ #' plot(node_in_betweenness(ison_adolescents)) +#' } #' @export node_in_betweenness <- function(.data){ if(missing(.data)) {expect_nodes(); .data <- .G()} diff --git a/R/member_equivalence.R b/R/member_equivalence.R index 76961b2f..943e27e7 100644 --- a/R/member_equivalence.R +++ b/R/member_equivalence.R @@ -77,8 +77,10 @@ node_in_equivalence <- function(.data, census, #' @examples #' \donttest{ #' (nse <- node_in_structural(ison_algebra)) +#' if(require("ggdendro", quietly = TRUE)){ #' plot(nse) #' } +#' } #' @export node_in_structural <- function(.data, k = c("silhouette", "elbow", "strict"), @@ -100,8 +102,10 @@ node_in_structural <- function(.data, #' \donttest{ #' (nre <- node_in_regular(ison_southern_women, #' cluster = "concor")) +#' if(require("ggdendro", quietly = TRUE)){ #' plot(nre) #' } +#' } #' @export node_in_regular <- function(.data, k = c("silhouette", "elbow", "strict"), @@ -126,6 +130,8 @@ node_in_regular <- function(.data, #' if(require("sna", quietly = TRUE)){ #' (nae <- node_in_automorphic(ison_southern_women, #' k = "elbow")) +#' } +#' if(require("ggdendro", quietly = TRUE)){ #' plot(nae) #' } #' } diff --git a/man/member_community_hier.Rd b/man/member_community_hier.Rd index f47034fb..b96aabbe 100644 --- a/man/member_community_hier.Rd +++ b/man/member_community_hier.Rd @@ -90,7 +90,9 @@ information about the hierarchical merging of communities is collected. \examples{ node_in_betweenness(ison_adolescents) +if(require("ggdendro", quietly = TRUE)){ plot(node_in_betweenness(ison_adolescents)) +} node_in_greedy(ison_adolescents) node_in_eigen(ison_adolescents) node_in_walktrap(ison_adolescents) diff --git a/man/member_equivalence.Rd b/man/member_equivalence.Rd index e596d5dd..db7f3847 100644 --- a/man/member_equivalence.Rd +++ b/man/member_equivalence.Rd @@ -106,17 +106,23 @@ assignment. \examples{ \donttest{ (nse <- node_in_structural(ison_algebra)) +if(require("ggdendro", quietly = TRUE)){ plot(nse) } +} \donttest{ (nre <- node_in_regular(ison_southern_women, cluster = "concor")) +if(require("ggdendro", quietly = TRUE)){ plot(nre) } +} \donttest{ if(require("sna", quietly = TRUE)){ (nae <- node_in_automorphic(ison_southern_women, k = "elbow")) +} +if(require("ggdendro", quietly = TRUE)){ plot(nae) } } diff --git a/tests/testthat/test-map_autograph.R b/tests/testthat/test-map_autograph.R index b5de7ddd..4f1c8fe8 100644 --- a/tests/testthat/test-map_autograph.R +++ b/tests/testthat/test-map_autograph.R @@ -111,6 +111,7 @@ test_that("named networks plot correctly", { # Test that autographr() works with arguments without quotes test_that("node_group works correctly", { skip_on_cran() + testthat::skip_if_not_installed("concaveman") expect_equal(graphr(ison_lawfirm, node_group = gender), graphr(ison_lawfirm, node_group = "gender")) })