Skip to content

Commit b0d3236

Browse files
committed
Rename growth_rate_global_params() -> growth_rate_params()
1 parent 8c92285 commit b0d3236

File tree

7 files changed

+52
-172
lines changed

7 files changed

+52
-172
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export(group_by)
8181
export(group_epi_df)
8282
export(group_modify)
8383
export(growth_rate)
84-
export(growth_rate_global_params)
84+
export(growth_rate_params)
8585
export(guess_period)
8686
export(is_epi_df)
8787
export(is_grouped_epi_archive)

R/growth_rate.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#' @param na_rm Should missing values be removed before the computation? Default
2525
#' is `FALSE`.
2626
#' @param params Additional arguments to pass to the method used to estimate the
27-
#' derivative. This should be created with `growth_rate_global_params()`.
27+
#' derivative. This should be created with `growth_rate_params()`.
2828
#' @return Vector of growth rate estimates at the specified points `x0`.
2929
#'
3030
#' @details The growth rate of a function f defined over a continuously-valued
@@ -122,7 +122,7 @@ growth_rate <- function(
122122
y, x = seq_along(y), x0 = x,
123123
method = c("rel_change", "linear_reg", "smooth_spline", "trend_filter"),
124124
h = 7, log_scale = FALSE, na_rm = FALSE,
125-
params = growth_rate_global_params()) {
125+
params = growth_rate_params()) {
126126
# Check x, y, x0
127127
if (length(x) != length(y)) cli_abort("`x` and `y` must have the same length.")
128128
method <- rlang::arg_match(method)
@@ -277,7 +277,7 @@ growth_rate <- function(
277277
}
278278
}
279279

280-
#' Optional parameters for global growth rate methods
280+
#' Optional parameters for growth rate methods
281281
#'
282282
#' Construct an object containing non-standard arguments for [growth_rate()].
283283
#'
@@ -305,7 +305,7 @@ growth_rate <- function(
305305
#' @return A list of parameter configurations.
306306
#' @importFrom checkmate assert_number
307307
#' @export
308-
growth_rate_global_params <- function(
308+
growth_rate_params <- function(
309309
df = NULL,
310310
lambda = NULL,
311311
cv = FALSE,

man/growth_rate.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/growth_rate_global_params.Rd

Lines changed: 0 additions & 120 deletions
This file was deleted.

tests/testthat/_snaps/growth_rate.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# global param constructor errors when required
22

33
Code
4-
growth_rate_global_params(df = -5)
4+
growth_rate_params(df = -5)
55
Condition
6-
Error in `growth_rate_global_params()`:
6+
Error in `growth_rate_params()`:
77
! Assertion on 'df' failed: Element 1 is not >= 0.
88

99
---
1010

1111
Code
12-
growth_rate_global_params(nlambda = 5:8)
12+
growth_rate_params(nlambda = 5:8)
1313
Condition
14-
Error in `growth_rate_global_params()`:
14+
Error in `growth_rate_params()`:
1515
! Assertion on 'nlambda' failed: Must have length 1.
1616

1717
# new setup args and warnings are as expected
@@ -45,7 +45,7 @@
4545
---
4646

4747
Code
48-
growth_rate(y = 1:20, method = "smooth_spline", params = growth_rate_global_params(
48+
growth_rate(y = 1:20, method = "smooth_spline", params = growth_rate_params(
4949
lambda = 1:20))
5050
Condition
5151
Error in `growth_rate()`:

0 commit comments

Comments
 (0)