pull_with_names {Nmisc} | R Documentation |
Pull out a single column
Description
Pull out a single column by using its name or its position and name the obtained vector using values from another column.
Usage
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
head(pull_with_names(iris, 4, "Species"))
[Package Nmisc version 0.3.7 Index]