What is select_at() for?

Viewed 709

I understand how to use dplyr::select_if() and dplyr::mutate_at(). But I don't understand what dplyr::select_at() provides that a basic select() doesn't provide.

As far as I understand, the verb_at() functions allow you to utilize the select helper functions (like matches() and starts_with()). But select() already uses the select helpers--so why would you use select_at() instead of just select()?

1 Answers

The primary benefit of select_at() (as opposed to the vanilla select()) is that it provides an .funs= parameter so that you can use a function, eg. toupper() to rename files as you select them.

This makes a ton of sense for something like rename_at(). Providing similar functionality with select_at() makes sense from a tidyverse-style "everything works the same" perspective.

Related