Replace NULL output.type based on geom and validate
other values. Convert synonyms and change into lower case mal-formed
input.
Usage
check_output_type(
output.type,
geom = "text",
supported.types = c("expression", "text", "markdown", "marquee", "numeric", "latex",
"latex.eqn", "latex.deqn")
)Value
If output.type is NULL a suitable value based on the
name of the geom is returned, defaulting to "expression". If not
NULL, the value is passed through unchanged.
Output types
The formatting of character strings to be displayed in plots are marked as mathematical equations. Depending on the geom used, the mark-up needs to be encoded differently, or in some cases mark-up not applied.
"expression"The labels are encoded as character strings to be parsed into R's plotmath expressions.
"LaTeX", "TeX", "tikz", "latex"The labels are encoded as 'LaTeX' maths equations, without the "fences" for switching in math mode.
"latex.eqn"Same as
"latex"but enclosed in single$, i.e., as in-line maths."latex.deqn"Same as
"latex"but enclosed in double$$, i.e., as display maths."markdown"The labels are encoded as character strings using markdown syntax, with some embedded HTML.
"marquee"The labels are encoded as character strings using markdown syntax, with 'marquee' supported spans.
"text"The labels are plain ASCII character strings.
"numeric"No labels are generated. This value is accepted by the statistics, but not by the label formatting functions.
NULLThe value used,
expression,latex.eqnormarkupdepends on the argument passed togeom.
If geom = "latex" (package 'xdvir') the output type used is
"latex.eqn". If geom = "richtext" (package 'ggtext') or
geom = "textbox" (package 'ggtext') the output type used is
"markdown". If geom = "marquee" (package 'marquee') the output
type used is "marquee". For all other values of geom the default
is "expression" unless the user passes an argument. Invalid values as
argument trigger an Error.
