Visits, pigs, occupation time and feed intake per station and hour of one day, for all 24 hours.
monitor_hours(data, date = NULL, station = NULL, verbose = 1)Station data: a folder or files of NEDAP or FIRE exports
(read with read_station()), a raw export already in R such as
tidypptsda::nedap, or the result of read_station() or
prep_visits().
The day. Default NULL: the last full day in the data
(see end_date in run_monitor()).
"nedap", "fire" or NULL (detect), passed to
read_station() and prep_visits().
0 (silent), 1 (summary, default) or 2 (details).
A data.table with one row per station (location) and
hour (0 to 23, from the entrance time): date, n_pigs,
n_visits, occupation_min and feed_kg.
h <- monitor_hours(tidypptsda::nedap, verbose = 0)
wide_table(h, "n_visits")
#> Key: <location>
#> location 00 01 02 03 04 05 06 07 08 09 10
#> <char> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 101 3 6 9 4 2 5 10 10 12 17 13
#> 2: 102 9 1 5 5 1 4 6 10 8 9 9
#> 11 12 13 14 15 16 17 18 19 20 21 22
#> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 12 9 4 10 17 15 17 14 9 6 0 0
#> 2: 10 3 1 13 10 10 13 13 13 9 0 0
#> 23 total
#> <int> <num>
#> 1: 0 204
#> 2: 0 162
h <- monitor_hours(tidypptsda::nedap, verbose = 0)
wide_table(h, "n_visits")
#> Key: <location>
#> location 00 01 02 03 04 05 06 07 08 09 10
#> <char> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 101 3 6 9 4 2 5 10 10 12 17 13
#> 2: 102 9 1 5 5 1 4 6 10 8 9 9
#> 11 12 13 14 15 16 17 18 19 20 21 22
#> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int> <int>
#> 1: 12 9 4 10 17 15 17 14 9 6 0 0
#> 2: 10 3 1 13 10 10 13 13 13 9 0 0
#> 23 total
#> <int> <num>
#> 1: 0 204
#> 2: 0 162