Pull a single variable from a data.table as a vector.
pull(.df, var = -1, name = NULL)
df <- data.table(
x = 1:3,
y = 1:3
)
# Grab column by name
df %>%
pull(y)
#> [1] 1 2 3
# Grab column by position
df %>%
pull(1)
#> [1] 1 2 3
# Defaults to last column
df %>%
pull()
#> [1] 1 2 3