a01_Calculate_Exposure_Times.Rmd
Load libraries
library("tidyverse")
library("rainy")
library("lubridate")
library("kableExtra")
read_csv(system.file(
"extdata",
"exposure_events.csv",
package = "rainy",
mustWork = TRUE
)) %>%
mutate(
date_time_out = dmy_hm(date_time_out),
date_time_removed = dmy_hm(date_time_removed),
`Exposure time (hours)` = round(
as.numeric(date_time_removed - date_time_out,
units = "hours"), 1),
`Date out` = date(date_time_out),
`Time out` = sprintf("%02d:%02d", hour(date_time_out),
minute(date_time_out)),
`Date removed` = date(date_time_removed),
`Time removed` = sprintf(
"%02d:%02d",
hour(date_time_removed),
minute(date_time_removed)
)
) %>%
rename(`Assessment date` = assessment_date,
`Rainfall event` = rainfall_event) %>%
select(
`Rainfall event`,
`Date out`,
`Time out`,
`Date removed`,
`Time removed`,
`Exposure time (hours)`,
`Assessment date`,
-c(date_time_out, date_time_removed)
) %>%
kable(format = "html",
table.attr = "class='table table-hover'",
caption = "Date and time trap plants deployed to and removed from
agriculture field site (Ag Plot) of the University of Southern
Queensland, Toowoobma, Qld with the date chickpea trap plants were
assessed for lesions for each rainfall event. Lesions were counted at
approximately fortnightly intervals after 48 h of incubation period")
#>
#> ── Column specification ────────────────────────────────────────────────────────
#> cols(
#> rainfall_event = col_double(),
#> date_time_out = col_character(),
#> date_time_removed = col_character(),
#> assessment_date = col_character()
#> )
Rainfall event | Date out | Time out | Date removed | Time removed | Exposure time (hours) | Assessment date |
---|---|---|---|---|---|---|
1 | 2020-02-24 | 19:10 | 2020-02-25 | 15:30 | 20.3 | 19/3/20 |
2 | 2020-02-28 | 17:00 | 2020-03-01 | 09:10 | 40.2 | 20/3/20 |
3 | 2020-03-03 | 20:10 | 2020-03-04 | 16:50 | 20.7 | 20/3/20 |
4 | 2020-07-14 | 13:00 | 2020-07-29 | 16:00 | 363.0 | 12/8/20 |
5 | 2020-08-06 | 15:00 | 2020-08-10 | 10:00 | 91.0 | 25/8/20 |
6 | 2020-08-15 | 07:10 | 2020-08-17 | 11:00 | 51.8 | 2/9/20 |
7 | 2020-11-24 | 08:00 | 2020-11-26 | 16:00 | 56.0 | 10/12/20 |