/pagedreport-example

Example of usage of pagedreport with pagedown in R

Primary LanguageHTML

Pagedreport and Pagedown to generate pretty reports in R

This repository contains a basic tutorial on the usage of the R packages pagedown and pagedreport.

Please refer to the authors website of both packages for more details:

Example report

This is an example report (pagedreport grid) in R Markdown using pagedreport:

This is the knitted output in PDF format:

Install

The package pagedown is in CRAN, to install it just run this command in the R console:

install.packages("pagedown")

The package pagedreport is not in CRAN, to install it from the R console:

remotes::install_github("rfortherestofus/pagedreport", ref = "main")

If the remotes object is not installed, install it from the R console:

install.packages("remotes")

Dependencies

Pagedown uses a Chromium-based browser such as Chromium, Google Chrome, or Microsoft Edge to translate from html to pdf. Any of these browsers must therefore be installed and available on the system's path.

In Ubuntu based operating systems, the following dependencies might need to be installed from the system's console:

  • rsvg
sudo apt install librsvg2-dev
  • magick
sudo apt install libmagick++-dev
  • curl
sudo apt install libcurl4-openssl-dev

Create a new report from template

In R Studio, to create a new report starting from a pagedreport template follow these steps:

Create a new R Markdown file... Select from template
1. Create a new R Markdown file. 2. Select a pagedreport template from the R Markdown dialog window.

After modifying the template, simply press the Knit button to generate the pdf report.