helpExtract: Extract Portions from R Help Files for Use in Documents

Description Usage Arguments Details Value Author(s) Examples

View source: R/helpExtract.R

Description

Extracts specified portions of R help files for use in Sweave or R-markdown documents.

Usage

1
helpExtract(Function, section = "Usage", type = "m_code", ...)

Arguments

Function

The function that you are extracting the help file from.

section

The section you want to extract. Defaults to "Usage".

type

The type of character vector you want returned. Defaults to "m_code". See Details

...

Other arguments passed to getHelpFile.

Details

The type argument accepts:

To insert a chunk into a markdown document, use something like:

```{r, echo=FALSE, results='asis'} cat(helpExtract(cor), sep = "\n") ```

To insert a chunk into a Sweave document, use something like:

\Sexpr{knit_child(textConnection(helpExtract(cor, type = "s_code")), options = list(tidy = FALSE, eval = FALSE))}

Value

A character vector to be used in a Sweave or R-markdown document.

Author(s)

Ananda Mahto

Examples

1
2
3
4
5
cat(helpExtract(cor), sep = "\n")

cat(helpExtract(cor, type = "m_text"))

cat(helpExtract(cor, type = "m_text", section="Description"))

mrdwab/SOfun documentation built on June 20, 2020, 6:15 p.m.