-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
64 lines (46 loc) · 1.85 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
52
53
54
55
56
57
58
59
60
61
62
63
64
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# htmlreportR
<!-- badges: start -->
[![R-CMD-check](https://github.com/AEstebanMar/htmlreportR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AEstebanMar/htmlreportR/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
htmlreportR has not been built from scratch. It is based on its Python equivalent and sister project, available at <https://pypi.org/project/py-report-html/> for a Python equivalent.
## Installation
Standard installation:
``` r
install.packages("htmlreportR")
```
You can install the development version of htmlreportR from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("AEstebanMar/htmlreportR")
```
## Example
There are two use cases for htmlreportR: script mode and package mode.
### Script mode
Simply call the html_report.R script, distributed with this package. Simply
provide a comma-separated list of files and a template to render, and you're done!
```{r script_example, engine = 'bash', eval = FALSE}
./scripts/html_report.R -d data1.txt,data2.txt -t template.txt
```
### Library mode
If you wish to use htmlreportR directly from R, you can! Here's how:
```{r library_example, eval = FALSE}
library(htmlreportR)
container <- list(data1 = data_frame_1, data2 = data_frame_2,
additional_field = "You can include anything in the container
and it will be available in plotter$hash_vars")
plotter <- htmlReport$new(title_doc = "Your report title",
container = container, tmp_folder = "tmp_lib",
src = "path/to/htmlreportR/scripts")
```