function "pick" is not found

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

The pick() function was introduced in dplyr 1.1. Do you have dplyr 1.1.0 or 1.1.1 in your library?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.