EVOLUTION-MANAGER
Edit File: loadRdMacros.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: Load User-defined Rd Help System Macros</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 loadRdMacros {tools}"><tr><td>loadRdMacros {tools}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Load User-defined Rd Help System Macros</h2> <h3>Description</h3> <p>Loads macros from an ‘<span class="file">.Rd</span>’ file, or from several ‘<span class="file">.Rd</span>’ files contained in a package. </p> <h3>Usage</h3> <pre> loadRdMacros(file, macros = TRUE) loadPkgRdMacros(pkgdir, macros) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>file</code></td> <td> <p>A file in Rd format containing macro definitions. </p> </td></tr> <tr valign="top"><td><code>macros</code></td> <td> <p><code>TRUE</code> or a previous set of macro definitions, in the format expected by the <code><a href="parse_Rd.html">parse_Rd</a></code> <code>macros</code> argument. </p> </td></tr> <tr valign="top"><td><code>pkgdir</code></td> <td> <p>The base directory of a source package or an installed package. </p> </td></tr> </table> <h3>Details</h3> <p>The files parsed by this function should contain only macro definitions; a warning will be issued if anything else other than comments or white space is found. </p> <p>The <code>macros</code> argument may be a filename of a base set of macros, or the result of a previous call to <code>loadRdMacros</code> or <code>loadPkgRdMacros</code> in the same session. These results should be assumed to be valid only within the current session. </p> <p>The <code>loadPkgRdMacros</code> function first looks for an <code>"RdMacros"</code> entry in the package ‘<span class="file">DESCRIPTION</span>’ file. If present, it should contain a comma-separated list of other package names; their macros will be loaded before those of the current package. It will then look in the current package for ‘<span class="file">.Rd</span>’ files in the ‘<span class="file">man/macros</span>’ or ‘<span class="file">help/macros</span>’ subdirectories, and load those. </p> <h3>Value</h3> <p>These functions each return an environment containing objects with the names of the newly defined macros from the last file processed. The parent environment will be macros from the previous file, and so on. The first file processed will have <code><a href="../../base/html/environment.html">emptyenv</a>()</code> as its parent. </p> <h3>Author(s)</h3> <p>Duncan Murdoch </p> <h3>References</h3> <p>See the ‘Writing <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> Extensions’ manual for the syntax of Rd files, or <a href="https://developer.r-project.org/parseRd.pdf">https://developer.r-project.org/parseRd.pdf</a> for a technical discussion. </p> <h3>See Also</h3> <p><code><a href="parse_Rd.html">parse_Rd</a></code> </p> <h3>Examples</h3> <pre> f <- tempfile() writeLines(paste0("\\newcommand{\\logo}{\\if{html}{\\figure{Rlogo.svg}{options: width=100}", "\\if{latex}{\\figure{Rlogo.pdf}{options: width=0.5in}}}"), f) m <- loadRdMacros(f) ls(m) ls(parent.env(m)) ls(parent.env(parent.env(m))) </pre> <hr /><div style="text-align: center;">[Package <em>tools</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>