mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2026-06-19 04:27:30 +02:00
Deploying to gh-pages from @ agdamsbo/FreesearchR@8c7fafe51c 🚀
This commit is contained in:
parent
6d545337de
commit
131294f901
166 changed files with 964 additions and 379 deletions
32
reference/unique_names.md
Normal file
32
reference/unique_names.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Make unique variable names
|
||||
|
||||
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
|
||||
|
||||
``` r
|
||||
unique_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 new variable names
|
||||
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
unique_names(c("var_x", "var_y", "var_x"), c("var_x", "var_z"))
|
||||
#> [1] "var_x_1" "var_y" "var_x_2"
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue