我想创建一个导出文本的函数,默认情况下,它能够确定操作系统使用的数字格式(例如“,”或“。”小数分隔符)。是否有任何R函数可以返回此信息?
答案 0 :(得分:7)
您可以使用Sys.localeconv()
返回:
decimal_point thousands_sep grouping int_curr_symbol currency_symbol mon_decimal_point mon_thousands_sep
"." "" "" "USD " "$" "." ","
mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space
"\003\003" "" "-" "2" "2" "1" "0"
n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn
"1" "0" "1" "1"