int2char                package:VLMC                R Documentation

_C_h_a_r_a_c_t_e_r - _I_n_t_e_g_e_r _C_o_n_v_e_r_s_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Simple conversion utilities for character to integer conversion
     and vice versa.

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

     int2char(i, alpha)
     char2int(x, alpha)

_A_r_g_u_m_e_n_t_s:

       i: integer vectors, typically in '0:m' when 'alpha' has m + 1
          letters.

   alpha: character string with several letters, representing the
          alphabet.

       x: character string, typically with letters from 'alpha'.

_V_a_l_u_e:

     'int2char()' gives a string (length 1 character) with as many
     characters as 'length(i)', by 0-indexing into the alphabet
     'alpha'.

     'char2int()' gives an integer vector of length 'nchar(x)' of
     integer codes according to 'alpha' (starting at 0 !).

_S_e_e _A_l_s_o:

     'int2alpha()' (which is used by 'int2char') and its inverse,
     'int2alpha()', both working with vectors of _single_ characters
     instead of multi-character strings.

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

     char2int("vlmc", paste(letters, collapse=""))

     int2char(c(0:3, 3:1), "abcd")
     int2char(c(1:0,3,3), "abc") # to eat ;-)

