pad                 package:emulator                 R Documentation

_S_i_m_p_l_e _p_a_d _f_u_n_c_t_i_o_n

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

     Places zeroes to the left of a string.  If the string consists
     only of digits 0-9, 'pad()' does not change the value of the
     string if interpreted as a numeric.

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

     pad(x,len,padchar="0",strict=TRUE)

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

       x: Input argument (converted to character)

     len: Desired length of output

 padchar: Character to pad x with, defaulting to "0".

  strict: Boolean variable governing the behaviour when length of 'x'
          is less than 'len'.  Under these circumstances, if 'strict'
          takes the default value of 'TRUE', then return an error; if
          'FALSE', return a truncated version of 'x' (least significant
          characters retained).

_A_u_t_h_o_r(_s):

     Robin K. S. Hankin

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

     pad("1234",len=10)
     pad("1234",len=3,strict=FALSE)

