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

  • the first page is an overview of the last day: stations, pigs, visits, feed intake, the alerts, a table of all stations and one of all houses, and the settings;

  • then one page per station: its alerts, the plots "trend", "intake", "weight" and "hours" of plot_monitor() and a table of its pigs.

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_monitor_report(
  x,
  path,
  title = NULL,
  locations = NULL,
  dpi = 150,
  open = FALSE,
  verbose = 1
)

Arguments

x

Result of run_monitor().

path

Folder to write to (created if needed). Files of an earlier report in the folder are overwritten.

title

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

locations

Stations to include. Default NULL: all.

dpi

Resolution of the plots. Default 150.

open

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

verbose

0 (silent) or 1 (summary, default).

Value

Invisibly, the path of index.html.

See also

write_monitor_tables() for the Excel workbook.

Examples

mon <- run_monitor(tidypptsda::nedap, verbose = 0)
dir <- file.path(tempdir(), "monitor_report")
write_monitor_report(mon, dir)
#> ✔ Report of 2 stations written to /tmp/RtmpBRLQC3/monitor_report/index.html
# then open file.path(dir, "index.html") in a web browser
unlink(dir, recursive = TRUE)
mon <- run_monitor(tidypptsda::nedap, verbose = 0)
dir <- file.path(tempdir(), "monitor_report")
write_monitor_report(mon, dir)
#> ✔ Report of 2 stations written to /tmp/RtmpBRLQC3/monitor_report/index.html
unlink(dir, recursive = TRUE)