pull

0th

Percentile

Pull out a single variable

This works like [[ for local data frames, and automatically collects before indexing for remote data tables.

Usage
pull(.data, var = -1)
Arguments
.data

A table of data

var

A variable specified as:

  • a literal variable name

  • a positive integer, giving the position counting from the left

  • a negative integer, giving the position counting from the right.

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 positions).

Aliases
  • pull
Examples
# NOT RUN {
mtcars %>% pull(-1)
mtcars %>% pull(1)
mtcars %>% pull(cyl)

# Also works for remote sources
if (requireNamespace("dbplyr", quietly = TRUE)) {
df <- dbplyr::memdb_frame(x = 1:10, y = 10:1, .name = "pull-ex")
df %>%
  mutate(z = x * y) %>%
  pull()
}

# }
Documentation reproduced from package dplyr, version 0.7.6, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.