R/write_monitor_report.R
write_monitor_report.RdWrite 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
)Result of run_monitor().
Folder to write to (created if needed). Files of an earlier report in the folder are overwritten.
Title of the report. Default: station type and window.
Stations to include. Default NULL: all.
Resolution of the plots. Default 150.
Open the report in the web browser when done. Default
FALSE.
0 (silent) or 1 (summary, default).
Invisibly, the path of index.html.
write_monitor_tables() for the Excel workbook.
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)