promptData               package:utils               R Documentation

_G_e_n_e_r_a_t_e _a _S_h_e_l_l _f_o_r _D_o_c_u_m_e_n_t_a_t_i_o_n _o_f _D_a_t_a _S_e_t_s

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

     Generates a shell of documentation for a data set.

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

     promptData(object, filename = NULL, name = NULL)

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

  object: an R object to be documented as a data set.

filename: usually, a connection or a character string giving the name
          of the file to which the documentation shell should be
          written. The default corresponds to a file whose name is
          'name' followed by '".Rd"'.  Can also be 'NA' (see below).

    name: a character string specifying the name of the object.

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

     Unless 'filename' is 'NA', a documentation shell for 'object' is
     written to the file specified by 'filename', and a message about
     this is given.

     If 'filename' is 'NA', a list-style representation of the
     documentation shell is created and returned.  Writing the shell to
     a file amounts to 'cat(unlist(x), file = filename, sep = "\n")',
     where 'x' is the list-style representation.

     Currently, only data frames are handled explicitly by the code.

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

     If 'filename' is 'NA', a list-style representation of the
     documentation shell.  Otherwise, the name of the file written to
     is returned invisibly.

_W_a_r_n_i_n_g:

     This function is still experimental.  Both interface and value
     might change in future versions.  In particular, it may be
     preferable to use a character string naming the data set and
     optionally a specification of where to look for it instead of
     using 'object'/'name' as we currently do.  This would be different
     from 'prompt', but consistent with other prompt-style functions in
     package 'methods', and also allow prompting for data set
     documentation without explicitly having to load the data set.

_S_e_e _A_l_s_o:

     'prompt'

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

     data(sunspots, package="stats")
     promptData(sunspots)
     unlink("sunspots.Rd")

