View source: R/HelperFunctions.R
| safe_replace_var | R Documentation |
Replaces a variable name only when it appears as a standalone term, avoiding accidental replacements inside other words.
safe_replace_var(x, old, new)
x |
Character vector to modify. |
old |
Character scalar, original variable name. |
new |
Character scalar, replacement variable name. |
Useful for plot formula labels, for example replacing "t" with "that" without changing "intercept" into "inthatercept".
Character vector with safe term-wise replacements.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.