make_names: Make unique variable names

View source: R/helpers.R

make_namesR Documentation

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())

Arguments

new

a vector of proposed new variable names

existing

a vector of existing variable names

Value

a vector of unique variable names

Author(s)

Tom Elliott

Examples

make_names(c("var_x", "var_y"), c("var_x", "var_z"))


iNZightVIT/iNZightTools documentation built on April 8, 2024, 10:25 a.m.