fv_num_percent: Convert a Numeric Vector to Number and Parenthetical...

Description Usage Arguments Value Examples

View source: R/fv_num_percent.R

Description

Convert a vector of numbers into a vector of strings with the number followed by the relative percentage in parenthesis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fv_num_percent(
  x,
  x_digits = getOption("numformdigits"),
  y_digits = x_digits,
  sep = "",
  comma = TRUE,
  ...
)

ffv_num_percent(...)

Arguments

x

A numeric vector.

x_digits

The number of digits to round the x vector.

y_digits

The number of digits to round the y vector.

sep

The separator between the first number and the leading parenthesis.

comma

logical. If TRUE the leading number is comma separated.

...

ignored.

Value

Returns a vector of parenthesis combined strings using vector x followed by the value as a relative percent in parenthesis.

Examples

1
2
fv_num_percent(1:10)
fv_num_percent(1:10, x_digits = 0, y_digits = 1, sep = " ")

numform documentation built on Oct. 10, 2021, 1:10 a.m.