percent: Simple Formatting of Percentages

percentR Documentation

Simple Formatting of Percentages

Description

Returns strings of the same length as p, displaying the 100 * p percentages.

Usage

percent(p, d = 0, sep = " ")

Arguments

p

number(s) in [0,1] – to be “displayed” as percentage(s).

d

number of digits after decimal point.

sep

separator to use before the final "%".

Value

character vector of the same length as p.

Author(s)

Martin Maechler

Examples

percent(0.25)
noquote(percent((1:10)/10))
(pc <- percent((1:10)/30, 1, sep=""))
noquote(pc)

sca documentation built on Jan. 14, 2023, 5:07 p.m.

Related to percent in sca...