diff --git a/DESCRIPTION b/DESCRIPTION index 2a9168a4..7b4beca8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: migraph Title: Many Network Measures, Motifs, Members, and Models Version: 1.4.0 -Date: 2024-05-23 +Date: 2024-07-08 Description: A set of tools for analysing multimodal networks. It includes functions for measuring centrality, centralization, cohesion, closure, constraint and diversity, @@ -30,10 +30,7 @@ Imports: network, future, furrr, - pillar, purrr, - rlang, - sna, tidygraph, tidyr Suggests: diff --git a/NAMESPACE b/NAMESPACE index 06803009..9177352f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -26,7 +26,6 @@ export(is_igraph) export(labs) export(mutate) export(network_reg) -export(node_adopter) export(rename) export(scale_y_discrete) export(test_distribution) @@ -56,6 +55,10 @@ importFrom(ggplot2,scale_y_discrete) importFrom(ggplot2,xlab) importFrom(ggplot2,ylab) importFrom(igraph,is_igraph) +importFrom(manynet,bind_node_attributes) +importFrom(manynet,generate_random) +importFrom(manynet,is_complex) +importFrom(manynet,is_directed) importFrom(network,as.network) importFrom(network,is.network) importFrom(purrr,flatten) diff --git a/R/migraph-defunct.R b/R/migraph-defunct.R index 71f90e20..f46e4284 100644 --- a/R/migraph-defunct.R +++ b/R/migraph-defunct.R @@ -18,11 +18,3 @@ test_gof <- function(diff_model, diff_models) { old = "test_gof") test_fit(diff_model, diff_models) } - -#' @describeIn defunct Deprecated on 2024-06-19. -#' @export -node_adopter <- function(diff_model) { - .Deprecated("node_in_adopter", package = "migraph", - old = "node_adopter") - node_in_adopter(diff_model) -} \ No newline at end of file diff --git a/R/model_tests.R b/R/model_tests.R index f627424c..10c9d790 100644 --- a/R/model_tests.R +++ b/R/model_tests.R @@ -21,11 +21,12 @@ NULL #' @rdname tests +#' @importFrom manynet generate_random bind_node_attributes is_directed is_complex #' @examples #' marvel_friends <- to_unsigned(ison_marvel_relationships) #' marvel_friends <- to_giant(marvel_friends) %>% #' to_subgraph(PowerOrigin == "Human") -#' (cugtest <- test_random(marvel_friends, network_heterophily, attribute = "Attractive", +#' (cugtest <- test_random(marvel_friends, manynet::net_heterophily, attribute = "Attractive", #' times = 200)) #' plot(cugtest) #' @export @@ -73,7 +74,7 @@ test_random <- function(.data, FUN, ..., #' @rdname tests #' @examples #' (qaptest <- test_permutation(marvel_friends, -#' network_heterophily, attribute = "Attractive", +#' manynet::net_heterophily, attribute = "Attractive", #' times = 200)) #' plot(qaptest) #' @export diff --git a/man/defunct.Rd b/man/defunct.Rd index b8c6e39d..359fd939 100644 --- a/man/defunct.Rd +++ b/man/defunct.Rd @@ -3,12 +3,9 @@ \name{defunct} \alias{defunct} \alias{test_gof} -\alias{node_adopter} \title{Functions that have been renamed, superseded, or are no longer working} \usage{ test_gof(diff_model, diff_models) - -node_adopter(diff_model) } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} @@ -23,7 +20,5 @@ wherever possible and update your scripts accordingly. \itemize{ \item \code{test_gof()}: Deprecated on 2024-06-16. -\item \code{node_adopter()}: Deprecated on 2024-06-19. - }} \keyword{internal} diff --git a/man/tests.Rd b/man/tests.Rd index ecf13f52..9648db86 100644 --- a/man/tests.Rd +++ b/man/tests.Rd @@ -68,11 +68,11 @@ of the original network. marvel_friends <- to_unsigned(ison_marvel_relationships) marvel_friends <- to_giant(marvel_friends) \%>\% to_subgraph(PowerOrigin == "Human") -(cugtest <- test_random(marvel_friends, network_heterophily, attribute = "Attractive", +(cugtest <- test_random(marvel_friends, manynet::net_heterophily, attribute = "Attractive", times = 200)) plot(cugtest) (qaptest <- test_permutation(marvel_friends, - network_heterophily, attribute = "Attractive", + manynet::net_heterophily, attribute = "Attractive", times = 200)) plot(qaptest) } diff --git a/tests/testthat/test-model_tests.R b/tests/testthat/test-model_tests.R index 26e9a58a..3cd280ba 100644 --- a/tests/testthat/test-model_tests.R +++ b/tests/testthat/test-model_tests.R @@ -19,7 +19,7 @@ test_that("test_random works", { expect_equal(length(cugtest$testdist), 200) # NB: Stochastic expect_false(cugtest$mode) expect_false(cugtest$diag) - expect_equal(cugtest$cmode, "csize") + expect_equal(cugtest$cmode, "edges") expect_equal(class(cugtest$plteobs), "numeric") expect_equal(class(cugtest$pgteobs), "numeric") expect_equal(cugtest$reps, 200) @@ -30,7 +30,7 @@ test_that("test_random works", { expect_equal(length(cugtest2$testdist), 200) # NB: Stochastic expect_false(cugtest2$mode) expect_false(cugtest2$diag) - expect_equal(cugtest2$cmode, "csize") + expect_equal(cugtest2$cmode, "edges") expect_equal(round(cugtest2$plteobs), 1) expect_equal(round(cugtest2$pgteobs), 0) expect_equal(cugtest2$reps, 200)