Rev 25408 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{prompt}\title{Produce Prototype of an R Documentation File}\alias{prompt}\alias{prompt.default}\alias{prompt.data.frame}\description{Facilitate the constructing of files documenting \R objects.}\usage{prompt(object, filename = NULL, name = NULL, \dots)\method{prompt}{default}(object, filename = NULL, name = NULL,force.function = FALSE, \dots)\method{prompt}{data.frame}(object, filename = NULL, name = NULL, \dots)}\arguments{\item{object}{an \R object, typically a function for the defaultmethod.}\item{filename}{usually, a connection or a character string giving thename of the file to which the documentation shell should be written.The default corresponds to a file whose name is \code{name} followedby \code{".Rd"}. Can also be \code{NA} (see below).}\item{name}{a character string specifying the name of the object.}\item{force.function}{a logical. If \code{TRUE}, treat \code{object}as function in any case.}\item{\dots}{further arguments passed to or from other methods.}}\value{If \code{filename} is \code{NA}, a list-style representation of thedocumentation shell. Otherwise, the name of the file written to isreturned invisibly.}\details{Unless \code{filename} is \code{NA}, a documentation shell for\code{object} is written to the file specified by \code{filename}, anda message about this is given. For function objects, this shellcontains the proper function and argument names. R documentationfiles thus created still need to be edited and moved into the\file{man} subdirectory of the package containing the object to bedocumented.If \code{filename} is \code{NA}, a list-style representation of thedocumentation shell is created and returned. Writing the shell to afile amounts to \code{cat(unlist(x), file = filename, sep = "\\n")},where \code{x} is the list-style representation.When \code{prompt} is used in \code{\link{for}} loops or scripts, theexplicit \code{name} specification will be useful.}\note{The documentation file produced by \code{prompt.data.frame} does nothave the same format as many of the data frame documentation files inthe \pkg{base} package. We are trying to settle on a preferredformat for the documentation.}\section{Warning}{Currently, calling \code{prompt} on a non-function object assumes thatthe object is in fact a data set and hence documents it as such. Thismay change in future versions of \R. Use \code{\link{promptData}} tocreate documentation skeletons for data sets.}\seealso{\code{\link{promptData}}, \code{\link{help}} and the chapter on\dQuote{Writing \R documentation} in \dQuote{Writing \R Extensions}(see the \file{doc/manual} subdirectory of the \R source tree).To prompt the user for input, see \code{\link{readline}}.}\author{Douglas Bates for \code{prompt.data.frame}}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth \& Brooks/Cole.}\examples{prompt(plot.default)prompt(interactive, force.function = TRUE)unlink("plot.default.Rd")unlink("interactive.Rd")data(women) # data.frameprompt(women)unlink("women.Rd")data(sunspots) # non-data.frame dataprompt(sunspots)unlink("sunspots.Rd")}\keyword{documentation}