diff --git a/.Rbuildignore b/.Rbuildignore index 9f275dbb..29964ad1 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -16,3 +16,5 @@ vignettes/precompile\.R ^CRAN-SUBMISSION$ ^README\.Rmd$ ^.mailmap$ +^\.positai$ +^\.claude$ diff --git a/.gitignore b/.gitignore index 4bb852d0..a1761a0b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ inst/tutorials/community/community_data/* inst/tutorials/equivalence/equivalence_data/* inst/tutorials/tutorial4/community_data/* inst/tutorials/tutorial5/equivalence_data/* +.positai diff --git a/DESCRIPTION b/DESCRIPTION index 7ca3a33d..29caa255 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,6 @@ Package: migraph Title: Inferential Methods for Multimodal and Other Networks -Version: 1.6.2 -Date: 2026-04-17 +Version: 1.6.3 Description: A set of tools for testing networks. It includes functions for univariate and multivariate conditional uniform graph and quadratic assignment procedure testing, @@ -18,10 +17,9 @@ License: MIT + file LICENSE Language: en-GB Encoding: UTF-8 LazyData: true -RoxygenNote: 7.3.3 Depends: - R (>= 3.6.0), - manynet (>= 1.0.5), + R (>= 4.1.0), + manynet (>= 2.0.0), autograph (>= 0.4.0), netrics Imports: @@ -64,3 +62,4 @@ Roxygen: list(markdown = TRUE, roclets = c("namespace", "rd")) Config/testthat/parallel: true Config/testthat/edition: 3 Config/testthat/start-first: tutorials_manynet +Config/roxygen2/version: 8.0.0 diff --git a/NAMESPACE b/NAMESPACE index 5faec42e..2026f1cd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,7 +17,6 @@ S3method(tidy,ergm) S3method(tidy,netlm) S3method(tidy,netlogit) S3method(tidy,sienaFit) -export("%>%") export(extract_tute) export(glance) export(net_regression) @@ -36,7 +35,6 @@ export(test_random) export(tidy) importFrom(autograph,ag_base) importFrom(dplyr,"%>%") -importFrom(dplyr,`%>%`) importFrom(dplyr,as_tibble) importFrom(dplyr,bind_cols) importFrom(dplyr,left_join) diff --git a/NEWS.md b/NEWS.md index daa98584..5b647ef7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,15 @@ +# migraph 1.6.3 + +2026-06-19 + +## Package + +- Removed `%>%` reexport plumbing and refreshed generated reexport docs accordingly + +## Testing + +- Updated diffusion goodness-of-fit logic (`test_fit()`) and its tests to use the newer diffusion representation (notably `t`) + # migraph 1.6.2 2026-04-17 diff --git a/R/migraph-package.R b/R/migraph-package.R index 162473cc..29dec8b5 100644 --- a/R/migraph-package.R +++ b/R/migraph-package.R @@ -20,7 +20,7 @@ thisRequires <- function(pkgname){ } # defining global variables more centrally -utils::globalVariables(c(".data", "obs", "fin","n","sim","time","value","conf.low","conf.high", +utils::globalVariables(c(".data", "obs", "fin","n","S","I","t","sim","time","value","conf.low","conf.high", "name")) # Suppress R CMD check note diff --git a/R/model_distrib.R b/R/model_distrib.R index 7afea13a..a79365f8 100644 --- a/R/model_distrib.R +++ b/R/model_distrib.R @@ -59,14 +59,15 @@ test_fit <- function(diff_model, diff_models){ # make into method? x <- diff_model if(manynet::is_graph(x)) x <- manynet::as_diffusion(x) y <- diff_models - sim <- `0` <- NULL - sims <- y %>% dplyr::select(sim, time, I) - if(max(x$time) < max(sims$time)){ + sims <- y %>% dplyr::select(sim, t, I) + if(max(x$t) < max(sims$t)){ + x <- dplyr::mutate(x, t = as.integer(t), S = as.integer(S), I = as.integer(I)) |> + dplyr::select(t, S, I) x <- dplyr::bind_rows(x, - dplyr::tibble(time = (max(x$time)+1):max(sims$time), + dplyr::tibble(t = (max(x$t)+1):max(sims$t), S = x$S[nrow(x)], I = x$I[nrow(x)])) } - sims <- as.data.frame.matrix(stats::xtabs(I ~ sim + time, sims)) # tidyr::pivot_wider replacement + sims <- as.data.frame.matrix(stats::xtabs(I ~ sim + t, sims)) # tidyr::pivot_wider replacement sims <- sims[,colSums(stats::cov(sims))!=0] mah <- stats::mahalanobis(x$I[-1], colMeans(sims), stats::cov(sims)) pval <- pchisq(mah, df=length(x$I[-1]), lower.tail=FALSE) diff --git a/R/reexports_classes.R b/R/reexports_classes.R deleted file mode 100644 index f24fabb2..00000000 --- a/R/reexports_classes.R +++ /dev/null @@ -1,5 +0,0 @@ -#' @importFrom dplyr `%>%` -#' @export -dplyr::`%>%` - -# #' @importFrom rlang `%||%` diff --git a/cran-comments.md b/cran-comments.md index bd6a0342..c0f88355 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,4 +9,4 @@ 0 errors | 0 warnings | 0 notes -- Updates to improve testing length +- Fixes reverse dependency issues for 'manynet' (and 'netrics') diff --git a/inst/migraph.png b/inst/migraph.png index 53e7af52..14b274da 100644 Binary files a/inst/migraph.png and b/inst/migraph.png differ diff --git a/man/migraph-package.Rd b/man/migraph-package.Rd index 1683d9bf..9102b428 100644 --- a/man/migraph-package.Rd +++ b/man/migraph-package.Rd @@ -21,6 +21,11 @@ Useful links: \author{ \strong{Maintainer}: James Hollway \email{james.hollway@graduateinstitute.ch} (\href{https://orcid.org/0000-0002-8361-9647}{ORCID}) (IHEID) [contributor] +Authors: +\itemize{ + \item James Hollway \email{james.hollway@graduateinstitute.ch} (\href{https://orcid.org/0000-0002-8361-9647}{ORCID}) (IHEID) [contributor] +} + Other contributors: \itemize{ \item Henrique Sposito (\href{https://orcid.org/0000-0003-3420-6085}{ORCID}) (IHEID) [contributor] diff --git a/man/reexports.Rd b/man/reexports.Rd index 4dce962b..4d9100fc 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -1,11 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/class_models.R, R/reexports_classes.R +% Please edit documentation in R/class_models.R \docType{import} \name{reexports} \alias{reexports} \alias{tidy} \alias{glance} -\alias{\%>\%} \title{Objects exported from other packages} \keyword{internal} \description{ @@ -13,8 +12,6 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{dplyr}{\code{\link[dplyr:reexports]{\%>\%}}} - - \item{generics}{\code{\link[generics]{glance}}, \code{\link[generics]{tidy}}} + \item{generics}{\code{\link[generics:glance]{glance()}}, \code{\link[generics:tidy]{tidy()}}} }} diff --git a/man/regression.Rd b/man/regression.Rd index ddd33bd0..ec3b6af1 100644 --- a/man/regression.Rd +++ b/man/regression.Rd @@ -113,7 +113,7 @@ Dekker, David, David Krackhard, and Tom A. B. Snijders. 2007. \doi{10.1007/s11336-007-9016-1}. } \seealso{ -Other models: +Other models: \code{\link{test_distributions}}, \code{\link{tests}} } diff --git a/man/test_distributions.Rd b/man/test_distributions.Rd index c139f3db..c89a6b70 100644 --- a/man/test_distributions.Rd +++ b/man/test_distributions.Rd @@ -57,7 +57,7 @@ then one can argue that the first diffusion is not well captured by # test_fit(x, y) } \seealso{ -Other models: +Other models: \code{\link{regression}}, \code{\link{tests}} } diff --git a/man/tests.Rd b/man/tests.Rd index d882795d..c33b0cbd 100644 --- a/man/tests.Rd +++ b/man/tests.Rd @@ -87,7 +87,7 @@ marvel_friends <- fict_marvel \%>\% to_uniplex("relationship") \%>\% # plot(qaptest) } \seealso{ -Other models: +Other models: \code{\link{regression}}, \code{\link{test_distributions}} } diff --git a/tests/testthat/test-model_distrib.R b/tests/testthat/test-model_distrib.R index ca4fac83..524a005f 100644 --- a/tests/testthat/test-model_distrib.R +++ b/tests/testthat/test-model_distrib.R @@ -5,7 +5,7 @@ test_that("test_distribution works", { }) test_that("test_fit works", { - x <- play_diffusion(generate_random(15), transmissibility = 0.7) + x <- as_diffusion(play_diffusion(generate_random(15), transmissibility = 0.7)) y <- play_diffusions(generate_random(15), transmissibility = 0.1, times = 40) res <- test_fit(x, y) expect_output(print(res), "statistic") diff --git a/tests/testthat/test-tutorials_autograph.R b/tests/testthat/test-tutorials_autograph.R index d41d50a0..18f2e357 100644 --- a/tests/testthat/test-tutorials_autograph.R +++ b/tests/testthat/test-tutorials_autograph.R @@ -11,4 +11,3 @@ test_that("autograph tutorial code runs without warnings or errors", { info = paste("Error in tutorial", basename(tute))) } }) -