Write the results of run_pipeline() as a folder with index.html and the plots (img/). Open index.html in a web browser:

  • the first page is an overview: number of pigs, mean ADG, ADFI and FCR, the QC settings, the pigs to check (low confidence or removed) and a table of all stations;

  • then one page per station: the growth plot (plot_adg()), the feed intake plot (plot_adfi()) and a table of its pigs with ADG, ADFI, FCR, status and the reason of a low confidence or removal.

Turn the pages with the arrow keys (or Page Up / Page Down, Home, End), the buttons or the list of stations; type a pig ID in the search box to jump to its station. Printing the page (e.g. to PDF) prints every page. The folder works offline and can be copied or zipped as a whole.

write_report(
  x,
  path,
  title = NULL,
  locations = NULL,
  dpi = 150,
  open = FALSE,
  verbose = 1,
  cores = 1
)

Arguments

x

Result of run_pipeline().

path

Folder to write to (created if needed). Existing files of an earlier report are overwritten.

title

Title of the report. Default: station type and dates.

locations

Stations to include. Default NULL: all.

dpi

Resolution of the plots. Default 150 (sharp on screen, about a quarter of the file size of 300).

open

Open the report in the web browser when done. Default FALSE.

verbose

0 (silent), 1 (summary and progress, default).

cores

Number of CPU cores for drawing the plots (see save_plots()). Default 1.

Value

Invisibly, the path of index.html.

Examples

res <- run_pipeline(nedap, verbose = 0)
dir <- file.path(tempdir(), "report")
write_report(res, dir)
#> 
#> ── Writing the HTML report ─────────────────────────────────────────────────────
#> Saving plots ■■■■■■■■■■■■■■■ 1/4 | ETA  4s
#> Saving plots ■■■■■■■■■■■■■■■ 2/4 | ETA  2s
#> Saving plots ■■■■■■■■■■■■■■■ 4/4 | ETA  0s
#> ✔ Saved 4 of 4 plots to /tmp/Rtmp93iRXT/report/img
#> ✔ Report of 2 stations written to /tmp/Rtmp93iRXT/report/index.html 4.7s
# then open file.path(dir, "index.html") in a web browser