We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data_frame(a = NA_real_) %>% summarise(a = max(a, na.rm = TRUE)) ## # A tibble: 1 × 1 ## a ## <dbl> ## 1 NA
The text was updated successfully, but these errors were encountered:
@hadley: I wonder what the behavior of the following should be:
data_frame(a = NA_integer_) %>% summarise(a = max(a, na.rm = TRUE)) data_frame(a = integer()) %>% summarise(a = max(a))
Current code sets a to NA_integer_. It would be more consistent with base R to return -Inf instead, but this requires promoting to numeric.
a
NA_integer_
-Inf
numeric
Sorry, something went wrong.
Does base R always return a numeric? That might be a consistent principle. What does/should max(NA) return?
max(NA)
max(int_arg) returns an integer in base R.
max(int_arg)
The hybrid version of max(NA_integer_) returns NA_integer_, with both na.rm = TRUE or = FALSE.
max(NA_integer_)
na.rm = TRUE
= FALSE
Merge branch 'master' into b-tidyverse#2305-min-max-inf
511ca1d
c6c0a1a
Merge branch 'b-tidyverse#2305-min-max-inf' into master-nosquash
91e98b5
krlmlr
No branches or pull requests
The text was updated successfully, but these errors were encountered: