Add report to a report.json to pipen-report to build a report
Methods
Method add2()
Add a content to the report, but infer the headings from headings and sub-headings
Usage
Reporter$add2(..., hs, hs2 = c(), ui = "flat", collapse = ": ")Arguments
...The content to add
hsThe headings of the case
hs2The headings that must be shown. When there are more items in
hs, they will be concatenated. For example, ifhs = c("Section1", "Case1"), andhs2 = c("A", "B"), then headings will beh1 = "Section1: Case1"andh2 = "A"andh3 = "B".uiThe user interface of the report
collapseThe separator to concatenate the headings
Method image()
Generate a report for an image to be added
Arguments
prefixThe prefix of the image
more_formatsMore formats of the image available
save_codeWhether to save the code to reproduce the plot
kindThe kind of the report, default is "image"
...Other arguments to add to the report
Examples
reporter <- get_reporter()
reporter$add(
list(
name = "Image 1",
contents = list(reporter$image("/path/to/image1", "pdf", save_code = TRUE))
),
h1 = "Images",
h2 = "Image 1"
)Method save()
Save the report to a file
Examples
## ------------------------------------------------
## Method `Reporter$image`
## ------------------------------------------------
reporter <- get_reporter()
reporter$add(
list(
name = "Image 1",
contents = list(reporter$image("/path/to/image1", "pdf", save_code = TRUE))
),
h1 = "Images",
h2 = "Image 1"
)