localeconv               package:base               R Documentation

_F_i_n_d _D_e_t_a_i_l_s _o_f _t_h_e _N_u_m_e_r_i_c_a_l _R_e_p_r_e_s_e_n_t_a_t_i_o_n_s _i_n _t_h_e _C_u_r_r_e_n_t _L_o_c_a_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Get details of the numerical representations in the current
     locale.

_U_s_a_g_e:

     Sys.localeconv()

_V_a_l_u_e:

     A character vector with 18 named components. See your ISO C
     documentation for details of the meaning.

     It is possible to compile R without support for locales, in which
     case the value will be 'NULL'.

_S_e_e _A_l_s_o:

     'Sys.setlocale' for ways to set locales: by default R uses the C
     clocal for '"LC_NUMERIC"' and '"LC_MONETARY"'.

_E_x_a_m_p_l_e_s:

     Sys.localeconv()
     ## The results in the default C locale are
     ##    decimal_point     thousands_sep          grouping   int_curr_symbol 
     ##              "."                ""                ""                "" 
     ##  currency_symbol mon_decimal_point mon_thousands_sep      mon_grouping 
     ##               ""                ""                ""                "" 
     ##    positive_sign     negative_sign   int_frac_digits       frac_digits 
     ##               ""                ""             "127"             "127" 
     ##    p_cs_precedes    p_sep_by_space     n_cs_precedes    n_sep_by_space 
     ##            "127"             "127"             "127"             "127" 
     ##      p_sign_posn       n_sign_posn 
     ##            "127"             "127"

     ## Now try your default locale (which might be "C").
     ## Not run: 
     old <- Sys.getlocale()
     Sys.setlocale(locale = "")
     Sys.localeconv()
     Sys.setlocale(locale = old)
     ## End(Not run)

     ## Not run: read.table("foo", dec=Sys.localeconv()["decimal_point"])

