add_refmark {tablesgg} | R Documentation |
Utility function to add a reference mark to each element of a character vector or matrix. This is an internal function, not intended to be called by package users.
add_refmark(text, textspec, mark, side, raise)
text |
Character vector or matrix of text strings to be marked. |
textspec |
Character vector or matrix, parallel to |
mark |
Character string to be used as the reference mark. |
side |
On which side of the text should the reference mark be placed, "before" or "after". |
raise |
Logical scalar. If TRUE, the reference mark will be displayed as a
superscript, using |
If raise
is TRUE, every element in the returned text will contain
either plotmath or markdown notation. If a text string was originally
"plain", the default is to use markdown if the package option
allowMarkdown
is TRUE, and plotmath otherwise.
It is an error if a "plain" text string contains newline (\n
)
characters but needs to be converted to plotmath to add a reference mark.
(plotmath
ignores newline characters.)
If raise
is FALSE, the textspec
value for each string is the
same as on input.
List with components text
and textspec
. The first will be a
character vector or matrix like input text
, updated to include the
reference mark in each string.
Component textspec
will be a character vector or matrix with the
same shape as text
, and value "plain", "plotmath", or "markdown",
according to the contents of text
after adding the reference mark.