Skip to contents

[Experimental]

assert_ggplot_label() ensures that the input is a valid ggplot2 label.

A ggplot2 label can be a character string or a latexexpression object.

Usage

assert_ggplot_label(x, null_ok = FALSE)

Arguments

x

A character string or a latexexpression object.

null_ok

(Optional) A logical flag indicating if NULL 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}$"))