Skip to contents

Turns a label into an identifier that a LaTeX control sequence accepts: letters only, with digits spelled out and every other character dropped. "CompoundA_5min" becomes "CompoundAfivemin".

Usage

cr_macro_name(x, prefix = NULL)

Arguments

x

Character vector of labels.

prefix

Optional prefix, transliterated the same way.

Value

A character vector of the same length as x.

Examples

cr_macro_name(c("CompoundA_5min", "interval-2", "n cells"))
#> [1] "CompoundAfivemin" "intervaltwo"      "ncells"          
cr_macro_name("estimate", prefix = "screen")
#> [1] "screenestimate"