round_spec: Make a rounding specification

View source: R/round_spec.R

round_specR Documentation

Make a rounding specification

Description

round_spec() creates a rounding specification object with default settings. The settings of a rounding specification object can be updated using functions in the round_ (see round_half_up, round_half_even, round_using_signif, round_using_decimal, and round_using_magnitude) and format_ (see format_missing, format_big, format_small, and format_decimal) families.

Usage

round_spec(force_default = FALSE)

Arguments

force_default

a logical value. If TRUE, then round_spec() ignores global options and uses its factory default values. If FALSE, round_spec() will access global options to determine its settings.

Details

Rounding specifications are meant to be passed into the table_glue and table_value functions. The specification can also be passed into table_ functions implicitly by saving a rounding specification into the global options.

The round_spec() function intentionally uses no input arguments. This is to encourage users to develop rounding specifications using the round_ and format_ families in conjunction with the pipe (%>%) operator.

Value

an object of class rounding_specification.

Examples


rspec <- round_spec()

table_value(x = pi, rspec)


table.glue documentation built on Feb. 16, 2023, 9:29 p.m.