mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 01:22:10 +01:00
26 lines
671 B
Text
26 lines
671 B
Text
|
|
% 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"))
|
||
|
|
|
||
|
|
}
|