This function powers
dplyr::pull() and various functions of the
tidyr package. It is similar to
vars_select() but returns only
one column name and has slightly different semantics: it allows
negative numbers to select columns from the end.
vars_pull(vars, var = -1)
A character vector of existing column names.
A variable specified as:
The default returns the last column (on the assumption that's the column you've created most recently).
This argument is taken by expression and supports quasiquotation (you can unquote column names and column locations).
The selected column name as an unnamed string.
# It takes its argument by expression: vars_pull(letters, c)#>  "c"# Negative numbers select from the end: vars_pull(letters, -3)#>  "x"# You can unquote variables: var <- 10 vars_pull(letters, !! var)#>  "j"