Learn R Programming

SciencesPo (version 1.02.12)

formatPercent: Format a numeric proportion

Description

Takes a number and formats it as a percentage.

Usage

formatPercent(x, digits = 1)

Arguments

x
a number or a vector whose numbers will be formated.
digits
the number of digits to be left.

Examples

Run this code
x <- c(.15, .00556, .55, 0.246)
formatPercent(x, 0)

Run the code above in your browser using DataLab