EVOLUTION-MANAGER
Edit File: Rdutils.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: Rd Utilities</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 Rdutils {tools}"><tr><td>Rdutils {tools}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Rd Utilities</h2> <h3>Description</h3> <p>Utilities for computing on the information in Rd objects.</p> <h3>Usage</h3> <pre> Rd_db(package, dir, lib.loc = NULL, stages = "build") </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>package</code></td> <td> <p>a character string naming an installed package.</p> </td></tr> <tr valign="top"><td><code>dir</code></td> <td> <p>a character string specifying the path to a package's root source directory. This should contain the subdirectory ‘<span class="file">man</span>’ with <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> documentation sources (in Rd format). Only used if <code>package</code> is not given.</p> </td></tr> <tr valign="top"><td><code>lib.loc</code></td> <td> <p>a character vector of directory names of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> libraries, or <code>NULL</code>. The default value of <code>NULL</code> corresponds to all libraries currently known. The specified library trees are used to search for <code>package</code>.</p> </td></tr> <tr valign="top"><td><code>stages</code></td> <td> <p>if <code>dir</code> is specified and the database is being built from source, which stages of <code style="white-space: pre;">\Sexpr</code> processing should be processed?</p> </td></tr> </table> <h3>Details</h3> <p><code>Rd_db</code> builds a simple database of all Rd objects in a package, as a list of the results of running <code><a href="parse_Rd.html">parse_Rd</a></code> on the Rd source files in the package and processing platform conditionals and some <code style="white-space: pre;">\Sexpr</code> macros. </p> <h3>See Also</h3> <p><code><a href="parse_Rd.html">parse_Rd</a></code> </p> <h3>Examples</h3> <pre> ## Build the Rd db for the (installed) base package. db <- Rd_db("base") ## Keyword metadata per Rd object. keywords <- lapply(db, tools:::.Rd_get_metadata, "keyword") ## Tabulate the keyword entries. kw_table <- sort(table(unlist(keywords))) ## The 5 most frequent ones: rev(kw_table)[1 : 5] ## The "most informative" ones: kw_table[kw_table == 1] ## Concept metadata per Rd file. concepts <- lapply(db, tools:::.Rd_get_metadata, "concept") ## How many files already have \concept metadata? sum(sapply(concepts, length) > 0) ## How many concept entries altogether? length(unlist(concepts)) </pre> <hr /><div style="text-align: center;">[Package <em>tools</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>