package.contents            package:base            R Documentation

_P_a_c_k_a_g_e _C_o_n_t_e_n_t_s _a_n_d _D_e_s_c_r_i_p_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Parses and returns the 'CONTENTS' and 'DESCRIPTION' file of a
     package.

_U_s_a_g_e:

     package.contents(pkg, lib.loc = NULL)
     package.description(pkg, lib.loc = NULL, fields = NULL)

_A_r_g_u_m_e_n_t_s:

     pkg: a character string with the package name.

 lib.loc: a character vector describing the location of R library trees
          to search through, or 'NULL'.  The default value of 'NULL'
          corresponds to all libraries currently known.

  fields: a character vector giving the tags of fields to return (if
          other fields occur in the file they are ignored).

_V_a_l_u_e:

     'package.contents' returns 'NA' if there is no 'CONTENTS' file for
     the given package; otherwise, a character matrix with column names
     'c("Entry", "Keywords", "Description")' and rows giving the
     corresponding entries in the CONTENTS data base for each Rd file
     in the package.

     If a 'DESCRIPTION' for the given package is found and can
     successfully be read, 'package.description' returns a named
     character vector with the values of the (given) fields as elements
     and the tags as names.  If not, it returns a named vector of 'NA's
     with the field tags as names if 'fields' is not null, and 'NA'
     otherwise.

_S_e_e _A_l_s_o:

     'read.dcf'

_E_x_a_m_p_l_e_s:

     package.contents("mva")
     package.contents("mva")[, c("Entry", "Description")]

     package.description("ts")
     package.description("ts")[c("Package", "Version")]
     ## NOTE: No subscripting using '$' or abbreviated field tags!

