flip_vector: Flips a vector's values and its names

Description Usage Arguments Details Examples

View source: R/flip_vector.R

Description

Flips a vector's values and its names

Usage

1

Arguments

x

Vector to be flipped

Details

This function is simply a wrapper for setNames(names(x), x)

Examples

1
2
3
x <- c(1, 2, 3)
names(x) <- c("a", "b", "c")
flip_vector(x)

pedrostrusso/prlib documentation built on Jan. 17, 2019, 11:10 a.m.