decimal_dot | R Documentation |
Sometimes it is necessary to use the dot character as the decimal separator.
In R, this could be affected by two settings: the global option
options(OutDec)
and the LC_NUMERIC
locale. This function sets the former
to .
and the latter to C
before evaluating an expression, such as
coercing a number to character.
decimal_dot(x)
x |
An expression. |
The value of x
.
opts = options(OutDec = ",")
as.character(1.234) # using ',' as the decimal separator
print(1.234) # same
xfun::decimal_dot(as.character(1.234)) # using dot
xfun::decimal_dot(print(1.234)) # using dot
options(opts)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.