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)

