pull: Extracts a column from a tbl object

Description Usage Arguments Value Source Examples

View source: R/data_handling.R

Description

Extracts a column from a tbl object

Usage

1
2
3
4
5
pull(object, column)

pull_string(object, column)

pull_ith(object, column)

Arguments

object

Object of type tbl

column

Column identifier, name as string or integer depending on function.

Value

Column as vector

Source

Tommy O'Dell: http://stackoverflow.com/questions/21618423/extract-a-dplyr-tbl-column-as-a-vector

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)

d <- data_frame(x = 1:10,
                y = rnorm(10))
d %>% pull(x)
d %>% pull("x")

v <- "x"
d %>% pull_string(v)

d %>% pull_ith(1)

sfeuerriegel/ResearchGroupTools documentation built on May 29, 2019, 8:01 p.m.