flextable_scibeautify: Apply scibeautify to a flextable

View source: R/flextable_scibeautify.R

flextable_scibeautifyR Documentation

Apply scibeautify to a flextable

Description

This is a wrapper around both flextable::flextable() and scibeautify() that applies flextable::as_sup() where needed to scientific notation superscripts.

Usage

flextable_scibeautify(data, .across = c(), ...)

Arguments

data

Input data frame

.across

Tidy-eval selector to apply scibeautify to

...

Arguments passed on to scibeautify

sci_mode

(Optional) Can be one of "auto" (automatically choose whether scientific notation is used based on string length optimization), "on", or "off" (scientific notation always on or off).

justify_mode

Mode to use for justifying a numbers. Can be "l" (left), "c" (center), "r" (right), or "d" (decimal). An "x" flag can be appended which will independently align the exponent portion of numbers in scientific notation, in addition to aligning the coefficient. Allowed values = c("l", "c", "r", "d", "lx", "cx", "rx", "dx").

auto_ignore_int

(Optional) If the data (or column) is all integers, will not truncate non-significant digits and will not use scientific notation

.cols

Tidy selector for columns when .data is a dataframe. Default = tidyr::everything().

.rows

Vector of row numbers indicating where scibeautify should be applied.

sig_digits

Number of significant digits. If NA or NULL, the input number is not changed.

pad_zeros

Whether to add extra trailing zeros and/or a decimal to force number of significant digits (even if the original number did not have that many digits). Default = FALSE.

decimal_mark

Character to use as the decimal marker.

big_mark

If not blank, character to use in grouping every big_interval digits before the decimal marker.

big_interval

Number of digits between each big_mark, if used.

nsmall

Forces output to have nsmall digits after the decimal. If there are fewer significant digits than total digits after including nsmall, the number of significant digits is increased.

Value

A flextable


adamleejohnson/R-ajtools documentation built on April 4, 2022, 7:24 a.m.