pull: Pull out a single variable

View source: R/pull.R

pullR Documentation

Pull out a single variable

Description

This is a direct replacement for ⁠[[.data.frame⁠.

Usage

pull(.data, var = -1)

Arguments

.data

A data.frame.

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

Examples

mtcars %>% pull(-1)
mtcars %>% pull(1)
mtcars %>% pull(cyl)
mtcars %>% pull("cyl")


poorman documentation built on Nov. 2, 2023, 5:27 p.m.