icuSetCollate              package:base              R Documentation

_S_e_t_u_p _C_o_l_l_a_t_i_o_n _b_y _I_C_U

_D_e_s_c_r_i_p_t_i_o_n:

     Controls the way collation is done by ICU (an optional part of the
     R build).

_U_s_a_g_e:

     icuSetCollate(...)

_A_r_g_u_m_e_n_t_s:

     ...: Named arguments, see 'Details'.

_D_e_t_a_i_l_s:

     Optionally, R can be built to collate character strings by ICU
     (<URL: http://www.icu-project.org>).  For such systems,
     'icuSetCollate' can be used to tune the way collation is done. On
     other builds calling this function does nothing, with a warning.

     Possible arguments are

     '_l_o_c_a_l_e': A character string such as '"da_DK"' giving the country
          whose collation rules are to be used.  If present, this
          should be the first argument.

     '_c_a_s_e__f_i_r_s_t': '"upper"', '"lower"' or '"default"', asking for
          upper- or lower-case characters to be sorted first.  The
          default is usually lower-case first, but not in all languages
          (see the Danish example).

     '_a_l_t_e_r_n_a_t_e__h_a_n_d_l_i_n_g': Controls the handling of 'variable'
          characters (mainly punctuation and symbols). Possible values
          are '"non_ignorable"' (primary strength) and '"shifted"'
          (quaternary strength).

     '_s_t_r_e_n_g_t_h': Which components should be used?  Possible values
          '"primary"', '"secondary"', '"tertiary"' (default),
          '"quaternary"' and '"identical"'. 

     '_f_r_e_n_c_h__c_o_l_l_a_t_i_o_n': In a French locale the way accents affect
          collation is from right to left, whereas in most other
          locales it is from left to right.  Possible values '"on"',
          '"off"' and '"default"'.

     '_n_o_r_m_a_l_i_z_a_t_i_o_n': Should strings be normalized? Possible values
          '"on"' and '"off"' (default). This affects the collation of
          composite characters.

     '_c_a_s_e__l_e_v_e_l': An additional level between secondary and tertiary,
          used to distinguish large and small Japanese Kana characters.
          Possible values '"on"' and '"off"' (default).

     '_h_i_r_a_g_a_n_a__q_u_a_t_e_r_n_a_r_y': Possible values '"on"' (sort Hiragana first
          at quaternary level) and '"off"'.

     Only the first three are likely to be of interest except to those
     with a  detailed understanding of collation and specialized
     requirements.

     Some examples are 'case_level="on", strength="primary"' to ignore
     accent differences, 'alternate_handling="shifted"' to ignore space
     and punctuation characters.

_S_e_e _A_l_s_o:

     Comparison, 'sort'

     The ICU user guide chapter on collation (<URL:
     http://www.icu-project.org/userguide/Collate_Intro.html>).

_E_x_a_m_p_l_e_s:

     x <- c("Aarhus", "aarhus", "safe", "test", "Zoo")
     sort(x)
     icuSetCollate(case_first="upper"); sort(x)
     icuSetCollate(case_first="lower"); sort(x)

     icuSetCollate(locale="da_DK", case_first="default"); sort(x)
     icuSetCollate(locale="et_EE"); sort(x)

