packageDescription           package:base           R Documentation

_P_a_c_k_a_g_e _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 'DESCRIPTION' file of a package.

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

     packageDescription(pkg, lib.loc = NULL, fields = NULL, drop=TRUE)

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

     pkg: a character string with the package name.

 lib.loc: a character vector of directory names of R libraries, or
          'NULL'.  The default value of 'NULL' corresponds to all
          libraries currently known.  If the default is used, the
          loaded packages are searched before the libraries.

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

    drop: If 'TRUE' and the length of 'fields' is 1, then a single
          character string with the value of the respective field is
          returned instead of an object of class
          '"packageDescription"'.

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

     If a 'DESCRIPTION' for the given package is found and can
     successfully be read, 'packageDescription' returns an object of
     class '"packageDescription"', which is a named list with the
     values of the (given) fields as elements and the tags as names,
     unless 'drop = TRUE'.

     If parsing the 'DESCRIPTION' file was not successful, it returns a
     named list 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', 'package.contents'

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

     packageDescription("stats")
     packageDescription("stats", fields = c("Package", "Version"))

     packageDescription("stats", fields = "Version")
     packageDescription("stats", fields = "Version", drop = FALSE)

