head                  package:utils                  R Documentation

_R_e_t_u_r_n _t_h_e _F_i_r_s_t _o_r _L_a_s_t _P_a_r_t _o_f _a_n _O_b_j_e_c_t

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

     Returns the first or last parts of a vector, matrix, data frame or
     function.

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

     head(x, ...)
     ## Default S3 method:
     head(x, n = 6, ...)
     ## S3 method for class 'data.frame':
     head(x, n = 6, ...)
     ## S3 method for class 'matrix':
     head(x, n = 6, ...)

     tail(x, ...)
     ## Default S3 method:
     tail(x, n = 6, ...)
     ## S3 method for class 'data.frame':
     tail(x, n = 6, ...)
     ## S3 method for class 'matrix':
     tail(x, n = 6, addrownums = TRUE, ...)

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

       x: an object

       n: size for the resulting object: number of elements for a
          vector (including lists), rows for a matrix or data frame or
          lines for a function.

addrownums: if there are no row names, create them from the row
          numbers.

     ...: arguments to be passed to or from other methods.

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

     For matrices and data frames, the first/last 'n' rows are
     returned. For functions, the first/last 'n' lines of the deparsed
     function are returned as character strings.

     If a matrix has no row names, then 'tail()' will add row names of
     the form '"[n,]"' to the result, so that it looks similar to the
     last lines of 'x' when printed.  Setting 'addrownums = FALSE'
     suppresses this behaviour.

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

     An object (usually) like 'x' but generally smaller.

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

     Patrick Burns, improved and corrected by R-Core

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

     head(freeny.x, n = 10)
     head(freeny.y)

     tail(freeny.x)
     tail(freeny.y)

     tail(library)

