Learn R Programming

cards (version 0.5.1)

label_round: Generate Formatting Function

Description

Returns a function with the requested rounding and scaling schema.

Usage

label_round(digits = 1, scale = 1, width = NULL)

Value

a function

Arguments

digits

(integer)
a non-negative integer specifying the number of decimal places round statistics to

scale

(numeric)
a scalar real number. Before rounding, the input will be scaled by this quantity

width

(integer)
a non-negative integer specifying the minimum width of the returned formatted values

Examples

Run this code
label_round(2)(pi)
label_round(1, scale = 100)(pi)
label_round(2, width = 5)(pi)

Run the code above in your browser using DataLab