Skip to contents

swap the names and values of a vector

Usage

swap_vecname(x)

Arguments

x

vector without duplicated values

Value

swapped vector

Examples

v <- c("a" = "A", "b" = "B", "c" = "C")
swap_vecname(v)
#>   A   B   C 
#> "a" "b" "c"