diff --git a/DESCRIPTION b/DESCRIPTION index 9bcc154d..eef3da4a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -49,7 +49,7 @@ License: GPL-3 URL: http://feasts.tidyverts.org/, https://github.com/tidyverts/feasts/ BugReports: https://github.com/tidyverts/feasts/issues Encoding: UTF-8 -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.2.9000 Roxygen: list(markdown = TRUE, roclets=c('rd', 'collate', 'namespace')) Language: en-GB RdMacros: lifecycle diff --git a/NAMESPACE b/NAMESPACE index de499163..d70a2e43 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -2,6 +2,7 @@ S3method("+",gg_tsensemble) S3method(autoplot,tbl_cf) +S3method(chooseOpsMethod,gg_tsensemble) S3method(components,classical_decomposition) S3method(components,feasts_x13arimaseats) S3method(components,stl_decomposition) diff --git a/R/graphics.R b/R/graphics.R index 299eac86..998d4960 100644 --- a/R/graphics.R +++ b/R/graphics.R @@ -728,11 +728,15 @@ gg_tsresiduals <- function(data, type = "innovation", ...){ } #' @export -`+.gg_tsensemble` <- function(e1, e2){ - e1[[1]] <- e1[[1]] + e2 +`+.gg_tsensemble` <- function(e1, e2) { + e1[[1L]] <- e1[[1L]] + e2 e1 } +#' @export +chooseOpsMethod.gg_tsensemble <- function(x, y, mx, my, cl, reverse) TRUE + + #' @export print.gg_tsensemble <- function(x, ...){ x <- lapply(x, ggplot2::ggplotGrob) diff --git a/tests/testthat/test-graphics.R b/tests/testthat/test-graphics.R index 6480d7d8..1c31a190 100644 --- a/tests/testthat/test-graphics.R +++ b/tests/testthat/test-graphics.R @@ -189,7 +189,7 @@ test_that("gg_tsdisplay() plots", { list(x = "index", y = "value") ) - p <- p + ggplot2::labs(x = "x", y = "y", title = "title") + p[[1]] <- p[[1]] + ggplot2::labs(x = "x", y = "y", title = "title") p_built <- ggplot2::ggplot_build(p[[1]]) @@ -267,11 +267,4 @@ test_that("gg_arma() plots", { ggplot2::layer_data(p, 4)$PANEL, factor(c(rep_along(ar_roots, 1), rep_along(ma_roots, 2))) ) - - p_built <- ggplot2::ggplot_build(p) - - expect_equivalent( - p_built$plot$labels[c("x", "y")], - list(x = "Re(1/root)", y = "Im(1/root)") - ) })