Skip to contents

Assigned names to a vector

Usage

vec_names(x, nm = NULL)

Arguments

x

a vector.

nm

a character vector. Default is NULL.

Value

a named vector.

Details

If nm = NULL, the names are the value of the vector (for the unnamed element.). vec_names is different from rlang::set_names: each each element of x, it assigns the values of x as its name when its names(x) is missing (values is "").