inttostr              package:Rstreams              R Documentation

_C_o_n_v_e_r_t_s _I_n_t_e_g_e_r_s _t_o _S_t_r_i_n_g_s _i_n _D_i_f_f_e_r_e_n_t _B_a_s_e_s

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

     Converts an integer to a string representation in base 2 to 36.

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

       inttostr(x, digits = 0, base = 16, complement = FALSE))

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

       x: a vector of integers to display

  digits: the minimum number of digits to use

    base: the numeric base of the representation

complement: whether to keep the sign on negatives or use a complement
          display

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

     All of the integers in x will be converted using the same number
     of digits.  

     If `complement=TRUE', then instead of keeping negative signs, all
     negative values will have `base^digits added'. In order for this
     scheme to produce unique strings, `base^digits/2' must be bigger
     than the largest number.  If this is not the case, then
     complements will not be taken.

     See the examples.

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

     a character vector giving the representation of each integer

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

     # Display using signed notation, with leading zeros
     inttostr(c(-1,1), 4)
     # Display using complement notation
     inttostr(c(-1,1), 4, complement=TRUE)

