Learn R Programming

sdbuildR (version 2.0.0)

clean_name: Clean variable name(s)

Description

Clean variable name(s) to create syntactically valid, unique names for use in R and Julia.

Usage

clean_name(new, protected = NULL)

Value

Vector of cleaned names

Arguments

new

Vector of names to transform to valid names

protected

Optional vector of protected names, e.g., existing names in model

Examples

Run this code
sfm <- stockflow("predator_prey")
# As the variable name "predator" is already taken, clean_name() will create
# a unique name
clean_name("predator", as.data.frame(sfm)[["name"]])

Run the code above in your browser using DataLab