Skip to contents

This is used to name the first temperature found as `temperature`, the second as `temperature2`, etc.

Usage

getNextName(name, existingNames)

Arguments

name

character value indicating the variable name.

existingNames

vector of character values of existing variable names.

Value

[getNextName] returns a deconflicted version of `name`.

Author

Dan Kelley

Examples

library(oceglider)
e <- NULL
e <- c(e, getNextName("S", e))
e <- c(e, getNextName("T", e))
e <- c(e, getNextName("S", e))
e <- c(e, getNextName("T", e))
e <- c(e, getNextName("p", e))
print(e)
#> [1] "S"  "T"  "S2" "T2" "p"