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.

name_col

The column whose values will be used to name the pulled column.

Value

A named vector.

Examples

1
pull_with_names(iris, 4, "Species")

numeract/Nmisc documentation built on July 18, 2018, 2:17 p.m.