FreesearchR/man/unique_names.Rd

25 lines
671 B
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/update-factor-ext.R
\name{unique_names}
\alias{unique_names}
\title{Make unique variable names}
\usage{
unique_names(new, existing = character())
}
\arguments{
\item{new}{a vector of proposed new variable names}
\item{existing}{a vector of existing variable names}
}
\value{
a vector of unique new 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.
}
\examples{
unique_names(c("var_x", "var_y", "var_x"), c("var_x", "var_z"))
}