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

FormatPercent

Format a Number as a Percentage


Description

This utility method can be used as a format function when converting trees to a data.frame

Usage

FormatPercent(x, digits = 2, format = "f", ...)

Arguments

x

A number

digits

The number of digits to print

format

The format to use

...

Any other argument passed to formatC

Value

A string corresponding to x, suitable for printing

See Also

formatC

Examples

data(acme)
print(acme, prob = acme$Get("p", format = FormatPercent))

data.tree

General Purpose Hierarchical Data Structure

v1.0.0
GPL (>= 2)
Authors
Russ Hyde [ctb] (improve dependencies), Chris Hammill [ctb] (improve getting), Facundo Munoz [ctb] (improve list conversion), Markus Wamser [ctb] (fixed some typos), Pierre Formont [ctb] (additional features), Kent Russel [ctb] (documentation), Noam Ross [ctb] (fixes), Duncan Garmonsway [ctb] (fixes), Christoph Glur [aut, cre] (R interface)
Initial release
2020-07-31

We don't support your browser anymore

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