Can anyone tell me why "pick" is not found in the following code
pacman::p_load(dplyr)
df <- tibble(x = 1:2, y = 3:4, z = 5:6)
df %>% mutate(total = rowSums(pick(where(is.numeric))))
#> Error in `mutate()`:
#> ! Problem while computing `total = rowSums(pick(where(is.numeric)))`.
#> Caused by error in `pick()`:
#> ! could not find function "pick"
#> Backtrace:
#> ▆
#> 1. ├─df %>% mutate(total = rowSums(pick(where(is.numeric))))
#> 2. ├─dplyr::mutate(., total = rowSums(pick(where(is.numeric))))
#> 3. ├─dplyr:::mutate.data.frame(., total = rowSums(pick(where(is.numeric))))
#> 4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())
#> 5. │ ├─base::withCallingHandlers(...)
#> 6. │ └─mask$eval_all_mutate(quo)
#> 7. ├─base::rowSums(pick(where(is.numeric)))
#> 8. │ └─base::is.data.frame(x)
#> 9. └─base::.handleSimpleError(...)
#> 10. └─dplyr (local) h(simpleError(msg, call))
#> 11. └─rlang::abort(...)
Created on 2023-03-24 with reprex v2.0.2