-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
reporter-listing.Rmd
50 lines (40 loc) · 1.25 KB
/
reporter-listing.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
---
title: "Example 1: Listing"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Example 1: Listing}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
### Create a Simple Listing
Here is an example of
a regulatory-style listing using **reporter** and the iris sample data frame.
Notice how the `write_report()` function breaks the page automatically
and appropriately:
```{r eval=FALSE, echo=TRUE}
library(reporter)
# Create temp file name
tmp <- file.path(tempdir(), "example1.pdf")
# Create the report
rpt <- create_report(tmp, orientation = "portrait", output_type = "PDF") %>%
page_header(left = "Client: 1-800-Flowers", right = "Study: Iris") %>%
titles("Listing 1.0", "IRIS Data Listing") %>%
add_content(create_table(iris)) %>%
footnotes("* Bulletin of the American Iris Society, 1935") %>%
page_footer(left = Sys.time(),
center = "Confidential",
right = "Page [pg] of [tpg]")
# Write the report
write_report(rpt)
# file.show(tmp)
```
<img src="../man/images/e1a.png"/>
<img src="../man/images/e1b.png"/>
<img src="../man/images/e1c.png"/>
Next: [Example 2: Table](reporter-table.html)