Rdutils {tools} | R Documentation

## Rd Utilities

### Description

Utilities for computing on the information in Rd objects.

### Usage

    Rd_db(package, dir, lib.loc = NULL)
    Rd_parse(file, text = NULL)

### Arguments

`package` | a character string naming an installed package.
`dir` | a character string specifying the path to a package's root source directory. This should contain the subdirectory ‘man’ with R documentation sources (in Rd format). Only used if `package` is not given.
`lib.loc` | a character vector of directory names of R libraries, or `NULL`. The default value of `NULL` corresponds to all libraries currently known. The specified library trees are used to search for `package`.
`file` | a connection, or a character string giving the name of a file or a URL to read documentation in Rd format from.
`text` | character vector with documentation in Rd format. Elements are treated as if they were lines of a file.

### Details

`Rd_db` builds a simple database of all Rd sources in a package, as a list of character vectors with the lines of the Rd files in the package. This is particularly useful for working on installed packages, where the individual Rd files in the sources are no longer available.

`Rd_parse` is a simple legacy top-level Rd parser/analyzer which is now deprecated in favor of the full `parse_Rd` parser, and will be removed in R 2.10.0. It returns a list with components

`meta`
  a list containing the Rd metadata (aliases, concepts, keywords, and documentation type);
`data`
  a data frame with the names (`tags`) and corresponding text (`vals`) of the top-level sections in the R documentation object;
`rest`
  top-level text not accounted for (currently, silently discarded by Rdconv, and hence usually the indication of a problem).

Note that at least for the time being, only the top-level structure is analyzed.

### Warning

These functions are still experimental. Names, interfaces and values might change in future versions.

### See Also

`parse_Rd`.

### Examples

    ## Build the Rd db for the (installed) base package.
    db <- Rd_db("base")

[Package tools version 2.9.2 Index]