count.fields              package:base              R Documentation

_C_o_u_n_t _t_h_e _N_u_m_b_e_r _o_f _F_i_e_l_d_s _p_e_r _L_i_n_e

_D_e_s_c_r_i_p_t_i_o_n:

     `count.fields' counts the number of fields, as separated by `sep',
     in each of the lines of `file' read.  It is used by `read.table'; 
     a user will typically have no need for it.

_U_s_a_g_e:

     count.fields(file, sep = "", quote = "\"'", skip = 0)

_A_r_g_u_m_e_n_t_s:

    file: a character string naming an ASCII data file

     sep: the field separator character.  Values on each line of the
          file are separated by this character.  By default, arbitrary
          amounts of whitespace can separate fields.

   quote: the set of quoting characters

    skip: the number of lines of the data file to skip before beginning
          to read data.

_V_a_l_u_e:

     A vector with the numbers of fields found.

_S_e_e _A_l_s_o:

     `read.table'

_E_x_a_m_p_l_e_s:

     cat("NAME", "1:John", "2:Paul", file = "foo", sep = "\n")
     count.fields("foo", sep = ":")
     unlink("foo")

