expfn: Convert numbers as expressions of exponential format

View source: R/expfn.r

expfnR Documentation

Convert numbers as expressions of exponential format

Description

Modify input numbers to expression class of exponential format like expression(1.35~'×'~10^{4}).

Usage

expfn(
  x,
  digits = 3,
  scale = 1,
  prefix = "",
  suffix = "",
  decimal.mark = ".",
  trim = TRUE,
  ...
)

Arguments

x

numeric vector.

digits

a number of digits just before '×'. Default: 3

scale

a number to multiply x. Default: 1.

prefix

a character string to paste just before x. Default: ”.

suffix

a character string to paste just after x. Default: ”.

decimal.mark

a character string to use decimal mark, Default: '.'.

trim

Logical, if ‘FALSE’, values are right-justified to a common width (see ‘base::format()’). Default: TRUE.

...

extra arguments passed to scientific().

Details

DETAILS

Value

An expression

See Also

str_extract scientific

Examples

expfn(c(1.2e8, 1.03e8, -Inf))
expfn(-Inf)

JK-junkin/frabento documentation built on Oct. 20, 2023, noon