locales                 package:base                 R Documentation

_Q_u_e_r_y _o_r _S_e_t _A_s_p_e_c_t_s _o_f _t_h_e _L_o_c_a_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Get details of or set aspects of the locale for the R process.

_U_s_a_g_e:

     Sys.getlocale(category = "LC_ALL")
     Sys.setlocale(category = "LC_ALL", locale = "")

_A_r_g_u_m_e_n_t_s:

category: character string. Must be one of `"LC_ALL"', `"LC_COLLATE"',
          `"LC_CTYPE"', `"LC_MONETARY"', `"LC_NUMERIC"' or `"LC_TIME"'.

  locale: character string. A valid locale name on the system in use.
          Normally `""' (the default) will pick up the default locale
          for the system.

_D_e_t_a_i_l_s:

     The locale describes aspects of the internationalization of a
     program. Initially mist aspects of the locale of R are set to
     `"C"' (which is the default for the C language and reflects
     North-American usage). R does set `"LC_COLLATE"' and 
     `"LC_CTYPE"', which allow the use of a different character set
     (typically ISO Latin 1) and alphabetic comparisons in that
     character set (including the use of `sort') and `"LC_TIME"' may
     affect the behaviour of `as.POSIXlt' and `strptime' and functions
     which use them (but not `date').

     R can be built with no support for locales, but it is normally
     available on Unix and is available on Windows.

     Some systems will have other locale categories, but the six
     described here are those specified by POSIX.

_V_a_l_u_e:

     A character string of length one describing the locale in use
     (after setting for `Sys.setlocale'), or an empty character string
     if the locale is invalid or `NULL' if locale information is
     unavailable.

     For `category = "LC_ALL"' the details of the string are
     system-specific: it might be a single locale or a set of locales
     separated by `"/"' (Solaris) or `";"' (Windows). For portability,
     it is best to query categories individually. It is guaranteed that
     the result of `foo <- Sys.getlocale()' can used in
     `Sys.setlocale("LC_ALL", locale = foo)' on the same machine.

_W_a_r_n_i_n_g:

     Setting `"LC_NUMERIC"' can produce output that R cannot then read
     by `scan' or `read.table' with their default arguments, which are
     not locale-specific.

_S_e_e _A_l_s_o:

     `strptime' for uses of `category = "LC_TIME"'. `localeconv' for
     details of numerical representations.

_E_x_a_m_p_l_e_s:

     Sys.getlocale()
     Sys.getlocale("LC_TIME")

     Sys.setlocale("LC_TIME", "de")     # Solaris: details are OS-dependent
     Sys.setlocale("LC_TIME", "German") # Windows

     Sys.setlocale("LC_COLLATE", "C")  # turn off locale-specific sorting

