We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 393370f commit 341be94Copy full SHA for 341be94
R/growth_rate.R
@@ -127,11 +127,10 @@ growth_rate <- function(
127
if (length(x) != length(y)) cli_abort("`x` and `y` must have the same length.")
128
method <- rlang::arg_match(method)
129
assert_class(params, "growth_rate_params")
130
- if (any(is.na(x)) || any(is.na(x0))) {
+ if (anyNA(x) || anyNA(x0)) {
131
cli_abort("Neither `x` nor `x0` may contain `NA`s.")
132
}
133
- dups <- duplicated(x)
134
- if (any(dups)) {
+ if (vctrs::vec_duplicate_any(x)) {
135
cli_abort(
136
"`x` contains duplicate values. (If being run on a
137
column in an `epi_df`, did you group by relevant key variables?)"
0 commit comments