prompt                 package:utils                 R Documentation

_P_r_o_d_u_c_e _P_r_o_t_o_t_y_p_e _o_f _a_n _R _D_o_c_u_m_e_n_t_a_t_i_o_n _F_i_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Facilitate the constructing of files documenting R objects.

_U_s_a_g_e:

     prompt(object, filename = NULL, name = NULL, ...)

     ## Default S3 method:
     prompt(object, filename = NULL, name = NULL,
            force.function = FALSE, ...)

     ## S3 method for class 'data.frame':
     prompt(object, filename = NULL, name = NULL, ...)

_A_r_g_u_m_e_n_t_s:

  object: an R object, typically a function for the default method.

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.

force.function: a logical.  If 'TRUE', treat 'object' as function in
          any case.

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

_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.  For function objects, this shell contains the
     proper function and argument names.  R documentation files thus
     created still need to be edited and moved into the 'man'
     subdirectory of the package containing the object to be
     documented.

     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.

     When 'prompt' is used in 'for' loops or scripts, the explicit
     'name' specification will be useful.

_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:

     The default filename may not be a valid filename under limited
     file systems (e.g. those on Windows).

     Currently, calling 'prompt' on a non-function object assumes that
     the object is in fact a data set and hence documents it as such. 
     This may change in future versions of R.  Use 'promptData' to
     create documentation skeletons for data sets.

_N_o_t_e:

     The documentation file produced by 'prompt.data.frame' does not
     have the same format as many of the data frame documentation files
     in the 'base' package.  We are trying to settle on a preferred
     format for the documentation.

_A_u_t_h_o_r(_s):

     Douglas Bates for 'prompt.data.frame'

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'promptData', 'help' and the chapter on "Writing R documentation"
     in "Writing R Extensions" (see the 'doc/manual' subdirectory of
     the R source tree).

     For creation of many help pages (for a package), see
     'package.skeleton'.

     To prompt the user for input, see 'readline'.

_E_x_a_m_p_l_e_s:

     require(graphics)
     prompt(plot.default)
     prompt(interactive, force.function = TRUE)
     unlink("plot.default.Rd")
     unlink("interactive.Rd")

     prompt(women) # data.frame
     unlink("women.Rd")

     prompt(sunspots) # non-data.frame data
     unlink("sunspots.Rd")

