I'm reading this tidy evaluation document https://tidyeval.tidyverse.org/sec-why-how.html and having trouble understanding why the first piece of code here doesn't work and the second does work:
starwars %>% summarise_at(ends_with("color"), n_distinct)
starwars %>% summarise_at(vars(ends_with("color")), n_distinct)
The first piece of code shows an error message: 'No tidyselect variables were registered'
I gather then that it's not able to find the columns in the starwars dataframe ending with color for some reason.
What is vars() doing to make it find the columns in the starwars dataframe? Is it something to do with the environment it's looking in?