EVOLUTION-MANAGER
Edit File: prompt.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Produce Prototype of an R Documentation File</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for prompt {utils}"><tr><td>prompt {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Produce Prototype of an R Documentation File</h2> <h3>Description</h3> <p>Facilitate the constructing of files documenting <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects. </p> <h3>Usage</h3> <pre> 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, ...) promptImport(object, filename = NULL, name = NULL, importedFrom = NULL, importPage = name, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object, typically a function for the default method. Can be <code><a href="../../base/html/missing.html">missing</a></code> when <code>name</code> is specified.</p> </td></tr> <tr valign="top"><td><code>filename</code></td> <td> <p>usually, a <a href="../../base/html/connections.html">connection</a> 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 <code>name</code> followed by <code>".Rd"</code>. Can also be <code>NA</code> (see below).</p> </td></tr> <tr valign="top"><td><code>name</code></td> <td> <p>a character string specifying the name of the object.</p> </td></tr> <tr valign="top"><td><code>force.function</code></td> <td> <p>a logical. If <code>TRUE</code>, treat <code>object</code> as function in any case.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> <tr valign="top"><td><code>importedFrom</code></td> <td> <p>a character string naming the package from which <code>object</code> was imported. Defaults to the environment of <code>object</code> if <code>object</code> is a function.</p> </td></tr> <tr valign="top"><td><code>importPage</code></td> <td> <p>a character string naming the help page in the package from which <code>object</code> was imported.</p> </td></tr> </table> <h3>Details</h3> <p>Unless <code>filename</code> is <code>NA</code>, a documentation shell for <code>object</code> is written to the file specified by <code>filename</code>, 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 ‘<span class="file">man</span>’ subdirectory of the package containing the object to be documented. </p> <p>If <code>filename</code> is <code>NA</code>, a list-style representation of the documentation shell is created and returned. Writing the shell to a file amounts to <code>cat(unlist(x), file = filename, sep = "\n")</code>, where <code>x</code> is the list-style representation. </p> <p>When <code>prompt</code> is used in <code><a href="../../base/html/Control.html">for</a></code> loops or scripts, the explicit <code>name</code> specification will be useful. </p> <p>The <code>importPage</code> argument for <code>promptImport</code> needs to give the base of the name of the help file of the original help page. For example, the <code><a href="../../stats/html/approxfun.html">approx</a></code> function is documented in ‘<span class="file">approxfun.Rd</span>’ in the <span class="pkg">stats</span> package, so if it were imported and re-exported it should have <code>importPage = "approxfun"</code>. Objects that are imported from other packages are not normally documented unless re-exported. </p> <h3>Value</h3> <p>If <code>filename</code> is <code>NA</code>, a list-style representation of the documentation shell. Otherwise, the name of the file written to is returned invisibly. </p> <h3>Warning</h3> <p>The default filename may not be a valid filename under limited file systems (e.g., those on Windows). </p> <p>Currently, calling <code>prompt</code> 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 <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. Use <code><a href="promptData.html">promptData</a></code> to create documentation skeletons for data sets. </p> <h3>Note</h3> <p>The documentation file produced by <code>prompt.data.frame</code> does not have the same format as many of the data frame documentation files in the <span class="pkg">base</span> package. We are trying to settle on a preferred format for the documentation. </p> <h3>Author(s)</h3> <p>Douglas Bates for <code>prompt.data.frame</code></p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="promptData.html">promptData</a></code>, <code><a href="help.html">help</a></code> and the chapter on “Writing <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> documentation” in “Writing <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> Extensions” (see the ‘<span class="file">doc/manual</span>’ subdirectory of the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> source tree). </p> <p>For creation of many help pages (for a package), see <code><a href="package.skeleton.html">package.skeleton</a></code>. </p> <p>To prompt the user for input, see <code><a href="../../base/html/readline.html">readline</a></code>. </p> <h3>Examples</h3> <pre> 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") ## Not run: ## Create a help file for each function in the .GlobalEnv: for(f in ls()) if(is.function(get(f))) prompt(name = f) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>