EVOLUTION-MANAGER
Edit File: package.skeleton.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: Create a Skeleton for a New Source Package</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 package.skeleton {utils}"><tr><td>package.skeleton {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a Skeleton for a New Source Package</h2> <h3>Description</h3> <p><code>package.skeleton</code> automates some of the setup for a new source package. It creates directories, saves functions, data, and R code files to appropriate places, and creates skeleton help files and a ‘<span class="file">Read-and-delete-me</span>’ file describing further steps in packaging. </p> <h3>Usage</h3> <pre> package.skeleton(name = "anRpackage", list, environment = .GlobalEnv, path = ".", force = FALSE, code_files = character(), encoding = "unknown") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>character string: the package name and directory name for your package.</p> </td></tr> <tr valign="top"><td><code>list</code></td> <td> <p>character vector naming the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects to put in the package. Usually, at most one of <code>list</code>, <code>environment</code>, or <code>code_files</code> will be supplied. See ‘Details’.</p> </td></tr> <tr valign="top"><td><code>environment</code></td> <td> <p>an environment where objects are looked for. See ‘Details’.</p> </td></tr> <tr valign="top"><td><code>path</code></td> <td> <p>path to put the package directory in.</p> </td></tr> <tr valign="top"><td><code>force</code></td> <td> <p>If <code>FALSE</code> will not overwrite an existing directory.</p> </td></tr> <tr valign="top"><td><code>code_files</code></td> <td> <p>a character vector with the paths to R code files to build the package around. See ‘Details’.</p> </td></tr> <tr valign="top"><td><code>encoding</code></td> <td> <p>optionally a <code><a href="../../base/html/character.html">character</a></code> string with an encoding for an optional <code>Encoding:</code> line in ‘<span class="file">DESCRIPTION</span>’ when non-ASCII characters will be used; typically one of <code>"latin1"</code>, <code>"latin2"</code>, or <code>"UTF-8"</code>; see the WRE manual.</p> </td></tr> </table> <h3>Details</h3> <p>The arguments <code>list</code>, <code>environment</code>, and <code>code_files</code> provide alternative ways to initialize the package. If <code>code_files</code> is supplied, the files so named will be sourced to form the environment, then used to generate the package skeleton. Otherwise <code>list</code> defaults to the objects in <code>environment</code> (including those whose names start with <code>.</code>), but can be supplied to select a subset of the objects in that environment. </p> <p>Stubs of help files are generated for functions, data objects, and S4 classes and methods, using the <code><a href="prompt.html">prompt</a></code>, <code><a href="../../methods/html/promptClass.html">promptClass</a></code>, and <code><a href="../../methods/html/promptMethods.html">promptMethods</a></code> functions. If an object from another package is intended to be imported and re-exported without changes, the <code><a href="prompt.html">promptImport</a></code> function should be used after <code>package.skeleton</code> to generate a simple help file linking to the original one. </p> <p>The package sources are placed in subdirectory <code>name</code> of <code>path</code>. If <code>code_files</code> is supplied, these files are copied; otherwise, objects will be dumped into individual source files. The file names in <code>code_files</code> should have suffix <code>".R"</code> and be in the current working directory. </p> <p>The filenames created for source and documentation try to be valid for all OSes known to run <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. Invalid characters are replaced by <span class="samp">_</span>, invalid names are preceded by <span class="samp">zz</span>, names are converted to lower case (to avoid case collisions on case-insensitive file systems) and finally the converted names are made unique by <code><a href="../../base/html/make.unique.html">make.unique</a>(sep = "_")</code>. This can be done for code and help files but not data files (which are looked for by name). Also, the code and help files should have names starting with an ASCII letter or digit, and this is checked and if necessary <code>z</code> prepended. </p> <p>Functions with names starting with a dot are placed in file ‘<span class="file">R/<var>name</var>-internal.R</span>’. </p> <p>When you are done, delete the ‘<span class="file">Read-and-delete-me</span>’ file, as it should not be distributed. </p> <h3>Value</h3> <p>Used for its side-effects. </p> <h3>References</h3> <p>Read the ‘Writing R Extensions’ manual for more details. </p> <p>Once you have created a <em>source</em> package you need to install it: see the ‘R Installation and Administration’ manual, <code><a href="INSTALL.html">INSTALL</a></code> and <code><a href="install.packages.html">install.packages</a></code>. </p> <h3>See Also</h3> <p><code><a href="prompt.html">prompt</a></code>, <code><a href="../../methods/html/promptClass.html">promptClass</a></code>, and <code><a href="../../methods/html/promptMethods.html">promptMethods</a></code>. </p> <p><code><a href="../../tools/html/package_native_routine_registration_skeleton.html">package_native_routine_registration_skeleton</a></code> for helping in preparing packages with compiled code. </p> <h3>Examples</h3> <pre> require(stats) ## two functions and two "data sets" : f <- function(x, y) x+y g <- function(x, y) x-y d <- data.frame(a = 1, b = 2) e <- rnorm(1000) package.skeleton(list = c("f","g","d","e"), name = "mypkg") </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>