dec_mark: Use Decimal Comma?

View source: R/dec_mark.R

dec_markR Documentation

Use Decimal Comma?

Description

These functions determine which characters the decimal mark and big mark should be that are used in the Certe R package functions. They base the determination on the R locale user settings.

Usage

dec_mark()

big_mark()

dec_mark_english()

Details

For dec_mark(): this returns a comma (",") on Dutch systems, and a full stop (".") otherwise. If the option "dec_mark" is set, that value will be used if it is either a comma or a full stop.

For big_mark(): this returns a full stop if dec_mark() returns a comma, and a space otherwise. If the option "big_mark" is set, that value will be used if it is either a comma (",") or a full stop (".") or a space (" ") or an empty character ("").

The function dec_mark_english() is short for options(dec_mark = ".", big_mark = " ") and useful for using the Certe R packages in English-based academic research. This function is session-specific, meaning that it must be set in every new R session (which is intended).

Examples

# according the current user settings / OS language:
dec_mark()
big_mark()

options(dec_mark = ",")
dec_mark()
big_mark()

options(dec_mark = ".")
dec_mark()
big_mark()

options(big_mark = ",")
dec_mark()
big_mark()

# clean up
options(dec_mark = NULL, big_mark = NULL)

certe-medical-epidemiology/certestyle documentation built on July 12, 2024, 2:45 p.m.