Learn R Programming

numform (version 0.6.4)

fv_num_percent: Convert a Numeric Vector to Number and Parenthetical Percentages

Description

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

Usage

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

Run this code
# NOT RUN {
fv_num_percent(1:10)
fv_num_percent(1:10, x_digits = 0, y_digits = 1, sep = " ")
# }

Run the code above in your browser using DataLab