This would be consistent with our general principles for handling NULL, and would support workflows like this:
library(dplyr, warn.conflicts = FALSE)
cond <- FALSE
mtcars %>%
summarise(
always = mean(gear),
optional = if(cond) mean(hp)
)
#> Error: Problem with `summarise()` input `optional`.
#> x Input `optional` must be a vector, not NULL.
#> ℹ Input `optional` is `if (cond) mean(hp)`.
Created on 2021-01-26 by the reprex package (v0.3.0.9001)
From https://twitter.com/pheymanss/status/1354116324159606785
This would be consistent with our general principles for handling
NULL, and would support workflows like this:Created on 2021-01-26 by the reprex package (v0.3.0.9001)
From https://twitter.com/pheymanss/status/1354116324159606785