Even though my Windows 7 locale settings specify using "," as a decimal separator, R and RStudio give me a "." separator. Is there any way to change this? Note the "LC_NUMERIC=C" setting in the locale below: this seems to be forced by R or RStudio.
As I am in the middle of a long project, I am unwilling to change right away to R 3.0 and the last RStudio version. Does anybody know is there is any change regarding the decimal separator issue in these versions?
I am using prettyNum to solve the problem for single numbers, but I don't know how to use it on a table.
R version 2.15.3 (2013-03-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
 LC_COLLATE=Spanish_Argentina.1252 LC_CTYPE=Spanish_Argentina.1252
 LC_MONETARY=Spanish_Argentina.1252 LC_NUMERIC=C
attached base packages:
 grid splines stats graphics grDevices utils datasets methods
other attached packages:
 ascii_2.1 randomForest_4.6-7 pander_0.3.3 fpc_2.1-5
 flexmix_2.3-10 mclust_4.0 cluster_1.14.3 MASS_7.3-23
 Gmisc_0.5.0.0 testthat_0.7 boot_1.3-7 rms_3.6-3
 miscTools_0.6-16 stringr_0.6.2 Hmisc_3.10-1 survival_2.37-2
 lattice_0.20-13 xtable_1.7-1 pixmap_0.4-11 RColorBrewer_1.0-5
loaded via a namespace (and not attached):
 digest_0.6.3 evaluate_0.4.3 modeltools_0.2-19 stats4_2.15.3
The decimal separator used by the
write.table functions (and most of their cousins) is set with "dec" parameter.
read.csv2 is a special case where the default for
dec is "," and the field separator ("sep") is set to ";".
You can change the output from R printing, plotting and the actions of the
as.character function. You change it from its default with:
options(OutDec= ",") # read ?options print( pi ) # 3,141593 options(OutDec= ",") # restore default value
This will NOT cause R to handle numeric input from the console differently. That is hard-coded to "." as the decimal separator.
If you applied a text function to a table object, you would be possibly coercing from a 'numeric' to a 'character' mode, since table objects in R inherit from the "matrix" class.