helpExtract | R Documentation |
Extracts specified portions of R help files for use in Sweave or R-markdown documents.
helpExtract(Function, section = "Usage", type = "m_code", ...)
Function |
The function that you are extracting the help file from. |
section |
The section you want to extract. Defaults to |
type |
The type of character vector you want returned. Defaults to
|
... |
Other arguments passed to |
The type
argument accepts:
"m_code"
: For use
with markdown documents in instances where highlighted code is expected, for
example the "Usage" section.
"m_text"
: For use with markdown
documents in instances where regular text is expected, for example the
"Description" section.
"s_code"
: For use with Sweave documents
in instances where highlighted code is expected, for example the "Usage"
section.
"s_text"
: For use with Sweave documents in instances
where regular text is expected, for example the "Description" section.
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))}
A character vector to be used in a Sweave or R-markdown document.
Reproduced here with helper functions defined from R source, so there are no ::: calls.
Ananda Mahto (https://github.com/mrdwab/SOfun)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.