-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[R] Let na.rm of mean() support removing NaN as in base R #44089
Copy link
Copy link
Closed as not planned
Labels
Component: RStatus: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwiseIssues and PRs flagged as stale which are due to be closed if no indication otherwiseType: enhancement
Description
Describe the enhancement requested
See the following example. In base R na.rm will also remove NaN values, because of the fact that is.na(NaN) == TRUE.
suppressPackageStartupMessages(library(dplyr))
data.frame(x = c(1, 2, NaN)) |>
arrow::as_arrow_table() |>
summarise(x_avg = mean(x, na.rm = TRUE)) |>
collect()
#> # A tibble: 1 × 1
#> x_avg
#> <dbl>
#> 1 NaNdata.frame(x = c(1, 2, NaN)) |>
summarise(x_avg = mean(x, na.rm = TRUE))
#> x_avg
#> 1 1.5Created on 2024-09-12 with reprex v2.1.0
Component(s)
R
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: RStatus: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwiseIssues and PRs flagged as stale which are due to be closed if no indication otherwiseType: enhancement