Description Usage Arguments Details Value Author(s) Examples
Extracts specified portions of R help files for use in Sweave or R-markdown documents.
1 | 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.
Ananda Mahto
1 2 3 4 5 | cat(helpExtract(cor), sep = "\n")
cat(helpExtract(cor, type = "m_text"))
cat(helpExtract(cor, type = "m_text", section="Description"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.