key(pedestrian)
key_vars(pedestrian)
key(tourism)
key_vars(tourism)
# Use as a tidyselect helper
library(dplyr)
tourism %>% select(index_var(), key_vars())
# Combine with other tidyselect functions
tourism %>% relocate(key_vars(), .after = last_col())
Run the code above in your browser using DataLab