pull_with_names: Pull out a single column

Description Usage Arguments Value Examples

View source: R/dplyr-misc.R

Description

Pull out a single column by using its name or its position and name the obtained vector using values from another column.

Usage

1
pull_with_names(.data, var = -1, name_col)

Arguments

.data

A data frame

var

The name of the column of interest, or a positive integer, giving the position counting from the left, or a negative integer, giving the position counting from the right. This argument supports tidyeval.

name_col

The column whose values will be used to name the pulled column. This argument supports tidyeval.

Value

A named vector.

Examples

1
head(pull_with_names(iris, 4, "Species"))

numeract/Nmisc documentation built on April 29, 2021, 9:56 a.m.