Learn R Programming

iNZightTools (version 2.0.1)

make_names: Make unique variable names

Description

Helper function to create new variable names that are unique given a set of existing names (in a data set, for example). If a variable name already exists, a number will be appended.

Usage

make_names(new, existing = character())

Value

a vector of unique variable names

Arguments

new

a vector of proposed new variable names

existing

a vector of existing variable names

Author

Tom Elliott

Examples

Run this code
make_names(c("var_x", "var_y"), c("var_x", "var_z"))

Run the code above in your browser using DataLab