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
character
string or alatexexpression
object.- null_ok
(Optional) A
logical
flag indicating ifNULL
values 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}$"))