assert_ggplot_label() ensures that the input is a valid
ggplot2 label.
A ggplot2 label can be a character string or a
latexexpression object.
Arguments
- x
A
characterstring or alatexexpressionobject.- null_ok
(Optional) A
logicalflag indicating ifNULLvalues are allowed (Default:FALSE).
Value
x (as invisible) if it passes the test; an
error message otherwise.
Examples
assert_ggplot_label("Test label")
assert_ggplot_label(latex2exp::TeX("$\\overline{x}$"))