-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
51 lines (37 loc) · 1.56 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#",
fig.path = "tools/images/README-"
)
```
# knitrhooks
**knitrhooks** provides useful **knitr** hooks to extend the functionality of **knitr**, **Rmarkdown** and **bookdown**.
## Available Hooks
The below table details the hooks currently available within the package. Some hooks are only available for particular output formats.
| hook name | description | HTML | PDF |
|---------------------|---------------------------------------------|--------|-------|
| `output_lines` | Print user specified lines of R output | X | X |
| `output_max_height` | Add a scrollbar to output of a given height | X | |
| `source_verbatim` | Print verbatim code chunks | X | X |
| `chunk_head` | Print chunk headers within outputs | X | X |
## Usage
Currently the package requires you to load the functionality of each given hook before you can use it. [Alternative](https://github.com/nathaneastwood/knitrhooks/issues/3) solutions are currently being considered.
<pre>
<code>```{r max_height_example}
library(knitrhooks)
output_max_height()
```</code>
# Example document
<code>```{r output_max_height = "300px"}
print(mtcars)
```</code>
</pre>
The above code will produce the following HTML document.
![scrollable_r_output](tools/images/README-example.PNG)