Learn R Programming

rapport (version 0.3)

pct: Percent

Description

Appends a percent sign to provided numerical value. Rounding is carried out according to value passed in decimals formal argument (defaults to value specified in rp.decimal.short option).

Usage

pct(x, digits = getOption("rp.decimal.short"),
    type = c("percent", "%", "proportion"),
    check.value = TRUE)

Arguments

x
a numeric value that is to be rendered to percent
digits
an integer value indicating number of decimal places
type
a character value indicating whether percent or proportion value was provided (partial match is allowed)
check.value
perform a sanity check to see if provided numeric value is correct

Value

  • a character value with formatted percent

Details

Default parameters are read from options:

  • 'rp.decimal.short'