You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
min and max throw an error if na.rm = TRUE and all values are NA #1357
From tidyverse/haven#528 - min() and max() throw an error if all values are NA and na.rm = TRUE.
The base R versions return Inf or -Inf respectively.
They should possibly return NA instead of Inf/-Inf, see #1004.
min(NA_real_, na.rm=TRUE)
#> Warning in min(NA_real_, na.rm = TRUE): no non-missing arguments to min;#> returning Inf#> [1] Infvctrs:::min.vctrs_vctr(NA_real_, na.rm=TRUE)
#> Error in idx[[1]]: subscript out of bounds
max(NA_real_, na.rm=TRUE)
#> Warning in max(NA_real_, na.rm = TRUE): no non-missing arguments to max;#> returning -Inf#> [1] -Infvctrs:::max.vctrs_vctr(NA_real_, na.rm=TRUE)
#> Error in idx[[1]]: subscript out of bounds
Activity
Fix `min()`, `max()` and `range()` where `na.rm = TRUE` and all value…