Skip to content

Commit 393370f

Browse files
committed
Make growth_rate(method = "trendfilter") without {trendfilter} a hard error
1 parent 0426ec4 commit 393370f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

NEWS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
1111
than before. In order to make `{epiprocess}` installation easier for users
1212
without a compiler, we have placed `{trendfilter}` in Suggests:; if you want
1313
to use `method = "trendfilter"` you will need to manually this dependency
14-
(e.g., with `remotes::install_github("glmgen/trendfilter")`). The interface for
15-
passing arguments to the `"smooth_spline"` and `"trend_filter"` methods has
16-
also changed.
14+
(e.g., with `remotes::install_github("glmgen/trendfilter")`). The interface
15+
for passing arguments to the `"smooth_spline"` and `"trend_filter"` methods
16+
has also changed.
1717
- In `revision_summary()`:
1818
- Output now uses the name `lag_near_latest` instead of `time_near_latest`. To
1919
migrate, update references to `time_near_latest` to `lag_near_latest`.

R/growth_rate.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
#' [trendfilter::trendfilter()], divided by the fitted value of the discrete
5353
#' spline at `x0`. This method requires the
5454
#' [`{trendfilter}` package](https://github.com/glmgen/trendfilter)
55-
#' to be installed (if it isn't, `method = "rel_change"` will be used and a
56-
#' warning issued).
55+
#' to be installed.
5756
#'
5857
#' ## Log Scale
5958
#'
@@ -139,11 +138,9 @@ growth_rate <- function(
139138
)
140139
}
141140
if (method == "trend_filter" && !requireNamespace("trendfilter", quietly = TRUE)) {
142-
method <- "rel_change"
143-
cli_warn(c(
141+
cli_abort(c(
144142
"The {.pkg trendfilter} package must be installed to use this option.",
145-
i = "It is available at {.url https://github.com/glmgen/trendfilter}.",
146-
i = 'The computation will proceed using `method = "rel_change"` instead.'
143+
i = "It is available at {.url https://github.com/glmgen/trendfilter}."
147144
))
148145
}
149146

0 commit comments

Comments
 (0)