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

FormatFixedDecimal

Format a Number as a Decimal


Description

Simple function that can be used as a format function when converting trees to a data.frame

Usage

FormatFixedDecimal(x, digits = 3)

Arguments

x

a numeric scalar or vector

digits

the number of digits to print after the decimal point

Value

A string corresponding to x, suitable for printing

Examples

data(acme)
print(acme, prob = acme$Get("p", format = function(x) FormatFixedDecimal(x, 4)))

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.