format_power-deprecated | R Documentation |
This function is deprecated because it's a special case of the new
format_numbers()
function. In addition, the new function includes features
not available in the deprecated function.
format_power(x, digits, ..., format, size, omit_power, set_power, delim)
x |
Numeric vector to be formatted. |
digits |
Numeric scalar between 1 and 20 (inclusive) defining the number of significant digits in result. |
... |
Not used, force later arguments to be used by name. |
format |
Character. Possible values are "engr" (default) for engineering
notation and and "sci" for scientific notation. Use argument by name. Can
also be set as a global option, for example,
|
size |
Font size. Possible values are "scriptsize", "small" (default),
"normalsize", "large", and "huge". which correspond to selected
LaTeX font size values. Can also be set as a global option, for example,
|
omit_power |
Numeric vector |
set_power |
Numeric scalar integer. Assigned exponent that overrides
|
delim |
Character vector (length 1 or 2) defining the delimiters for
marking up inline math. Possible values include |
Convert the elements of a numerical vector to character strings in which the numbers are formatted using powers-of-ten notation in scientific or engineering form and delimited for rendering as inline equations in an R Markdown document.
Given a number, a numerical vector, or a numerical column from a data frame,
format_power()
converts the numbers to character strings of the form, "$a \\times 10^{n}$"
, where a
is the coefficient and n
is the exponent. The
string includes markup delimiters $...$
for rendering as an inline equation
in R Markdown or Quarto Markdown document.
The user can specify either scientific or engineering format and the number of significant digits.
Powers-of-ten notation is omitted over a range of exponents via omit_power
such that numbers are converted to character strings of the form, "$a$"
,
where a
is the number in decimal notation. The default omit_power = c(-1, 2)
formats numbers such as 0.123, 1.23, 12.3, and 123 in decimal form. To
cancel these exceptions and convert all numbers to powers-of-ten notation,
set the omit_power
argument to NULL.
Delimiters for inline math markup can be edited if necessary. If the default
argument fails, try using "\\("
as an alternative. If using a custom
delimiter to suit the markup environment, be sure to escape all special
symbols.
A character vector with numbers represented in powers of ten notation and delimited as inline math markup.
formatdown-deprecated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.