Learn R Programming

icd (version 3.3)

swap_names_vals: swap names and values of a vector

Description

Swap names and values of a vector. Non-character values are implicitly converted to names.

Usage

swap_names_vals(x)

Arguments

x

named vector

Value

vector, with values being the names of the input vector, and names being the previous values.