I am trying to select all columns and when I directed copy and pasted the example from the tidyverse help website I am getting an error. Any help on the error is greatly appreciated
library(dplyr)
#> Warning: package 'dplyr' was built under R version 4.3.3
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
iris %>%
select(all_of(vars))
#> Error in `select()`:
#> ℹ In argument: `all_of(vars)`.
#> Caused by error in `all_of()`:
#> ! Can't subset elements.
#> ✖ Subscript must be numeric or character, not a function.
Created on 2024-06-12 with reprex v2.1.0