Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

percent

Numeric vector with percentage representation


Description

Numeric vector with percentage representation

Usage

percent(x, digits, format = "f", ...)

## Default S3 method:
percent(x, digits = 2L, format = "f", ...)

## S3 method for class 'character'
percent(x, digits = NA, format = "f", ...)

Arguments

x

a numeric vector.

digits

an integer to indicate the number of digits of the percentage string.

format

format type passed to formatC.

...

additional parameters passed to formattable.

Examples

percent(rnorm(10, 0, 0.1))
percent(rnorm(10, 0, 0.1), digits = 0)
percent("0.5%")
percent(c("15.5%", "25.12%", "73.5"))

formattable

Create 'Formattable' Data Structures

v0.2.1
MIT + file LICENSE
Authors
Kun Ren [aut, cre], Kenton Russell [aut]
Initial release
2021-01-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.