If you ever get tired of having to write table_glue(..., rspec = your_rspec) and would rather just write table_glue(...), you can use the make_default_rounder() function on your_rspec to temporarily update options in your current R session and update the default rounding specification to match whatever your current rounding specification is. Naturally, mistakes will be made when make_default_rounder() is used. To reset the rounding specifications to factory defaults, use reset_default_rounder().

make_default_rounder(rspec)

reset_default_rounder()

Arguments

rspec

a rounding_specification object (see round_spec).

Value

make_default_rounder() changes global options and does not return a value.

Details

Setting a default rounding specification will impact all functions in the table helpers family. Use with caution! Also, please make all use of make_default_rounder() explicit in your code so that it can be reproduced. It is highly recommended that you do not use make_default_rounder() in your .Rprofile.

Examples

your_rspec <- round_using_decimal(round_spec(), digits = 10) your_rspec <- format_small(your_rspec, mark = '--') # now your_rspec is the default. make_default_rounder(your_rspec) # so it is applied whenever you use table_value(), # unless you specify otherwise. table_value(rnorm(5))
#> [1] "-1.40004--35167" "0.25531--70548" "-2.43726--36112" "-0.00557--12867" #> [5] "0.62155--27214"