diff --git a/DESCRIPTION b/DESCRIPTION index a1f612a..38b7f65 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: autograph Title: Automatic Plotting and Theming of Many Graphs -Version: 1.0.2 -Date: 2026-04-30 +Version: 1.0.3 +Date: 2026-05-01 Description: Visual exploration and presentation of networks should not be difficult. This package includes functions for plotting networks and network-related metrics with sensible and pretty defaults. It includes 'ggplot2'-based plot methods for many popular network package classes. diff --git a/NAMESPACE b/NAMESPACE index 6feb67e..1115623 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -79,6 +79,7 @@ export(layout_tbl_graph_valence) export(layout_tetrad) export(layout_triad) export(layout_valence) +export(load_ergm_res) export(match_color) export(scale_colour_hue) export(scale_size) diff --git a/NEWS.md b/NEWS.md index 6019909..934fbab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# autograph 1.0.3 + +## Plotting + +- Fixed the error produced by a namespace reference in a call in `ergm_res` by serializing it, moving to extdata, and loading it via `load_ergm_res()` + # autograph 1.0.2 ## Plotting diff --git a/R/data_precooked.R b/R/data_precooked.R index 4f279e7..6890c2f 100644 --- a/R/data_precooked.R +++ b/R/data_precooked.R @@ -62,12 +62,6 @@ # ERGM objects #### -#' @docType data -#' @keywords datasets -#' @rdname made_earlier -#' @usage data(ergm_res) -"ergm_res" - #' @docType data #' @keywords datasets #' @rdname made_earlier diff --git a/R/plot_convergence.R b/R/plot_convergence.R index 71d5709..bcb52c8 100644 --- a/R/plot_convergence.R +++ b/R/plot_convergence.R @@ -64,6 +64,7 @@ plot.traces.monan <- function(x, ...) { #' @rdname plot_convergence #' @family ergm #' @examples +#' ergm_res <- load_ergm_res() #' plot(ergm_res) #' @export plot.ergm <- function(x, ...) { @@ -81,3 +82,9 @@ plot.ergm <- function(x, ...) { plot.ag_conv(dat) } +#' @rdname plot_convergence +#' @export +load_ergm_res <- function() { + readRDS(file = system.file("extdata", "ergm_res.rds", package = "autograph")) +} + diff --git a/cran-comments.md b/cran-comments.md index 35c6582..2cb9494 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -9,4 +9,4 @@ 0 errors | 0 warnings | 0 notes -- Fixed the error in some flavours by removing environment references in included objects +- Fixed the error in some flavours by moving offending data to inst/extdata diff --git a/data/ergm_res.rda b/data/ergm_res.rda deleted file mode 100644 index 3989efe..0000000 Binary files a/data/ergm_res.rda and /dev/null differ diff --git a/inst/extdata/ergm_res.rds b/inst/extdata/ergm_res.rds new file mode 100644 index 0000000..ae21268 Binary files /dev/null and b/inst/extdata/ergm_res.rds differ diff --git a/man/made_earlier.Rd b/man/made_earlier.Rd index 709e577..890446c 100644 --- a/man/made_earlier.Rd +++ b/man/made_earlier.Rd @@ -12,7 +12,6 @@ \alias{siena_selection} \alias{monan_conv} \alias{monan_gof} -\alias{ergm_res} \alias{ergm_gof} \alias{goldfish_outliers} \alias{goldfish_changepoints} @@ -36,8 +35,6 @@ An object of class \code{traces.monan} of length 3. An object of class \code{gof.stats.monan} of length 2. -An object of class \code{ergm} of length 35. - An object of class \code{gof.ergm} (inherits from \code{gof}) of length 30. An object of class \code{outliers.goldfish} (inherits from \code{dependent.goldfish}, \code{data.frame}) with 12 rows and 7 columns. @@ -63,8 +60,6 @@ data(monan_conv) data(monan_gof) -data(ergm_res) - data(ergm_gof) data(goldfish_outliers) diff --git a/man/plot_convergence.Rd b/man/plot_convergence.Rd index 39e47e8..895e9fb 100644 --- a/man/plot_convergence.Rd +++ b/man/plot_convergence.Rd @@ -5,6 +5,7 @@ \alias{plot.ag_conv} \alias{plot.traces.monan} \alias{plot.ergm} +\alias{load_ergm_res} \title{Plotting convergence diagnostics} \usage{ \method{plot}{ag_conv}(x, ...) @@ -12,6 +13,8 @@ \method{plot}{traces.monan}(x, ...) \method{plot}{ergm}(x, ...) + +load_ergm_res() } \arguments{ \item{x}{An object of class "traces.monan".} @@ -33,6 +36,7 @@ distribution. } \examples{ plot(monan_conv) +ergm_res <- load_ergm_res() plot(ergm_res) } \seealso{ diff --git a/tests/testthat/test-plot_convergence.R b/tests/testthat/test-plot_convergence.R index b01d5e2..7276cae 100644 --- a/tests/testthat/test-plot_convergence.R +++ b/tests/testthat/test-plot_convergence.R @@ -6,6 +6,7 @@ test_that("monan diagnostics works", { test_that("ergm diagnostics works", { skip_on_os("linux") # CRAN R CMD check issue + ergm_res <- load_ergm_res() p <- plot(ergm_res) expect_s3_class(p, "ggplot") })