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 _a_n_d _M_o_n_e_t_a_r_y _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 and monetary representations in the
     current locale.

_U_s_a_g_e:

     Sys.localeconv()

_D_e_t_a_i_l_s:

     These settings are usually controlled by the environment variables
     'LC_NUMERIC' and 'LC_MONETARY' and if not set the values of
     'LC_ALL' or 'LANG'.

     Normally R is run without looking at the value of 'LC_NUMERIC', so
     the decimal point remains ''.''.  So the first three of these
     values will not be useful unless you have set 'LC_NUMERIC' in the
     current R session.

_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.

_E_x_a_m_p_l_e_s:

     Sys.localeconv()
     ## The results in the 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"])

