Skip to contents

Calculate epidemic onset

Usage

calc_epidemic_onset(start, end, c_closure, weather, cultivar_sus = 5)

Arguments

start

POSIXct, start date in which to begin calculating the epidemic onset, if not specified, the first date in the weather data will be used.

end

POSIXct, end date, last date to complete calculating the epidemic onset, if not specified, the last date in the weather data will be used.

c_closure

POSIXct formatted date to start the model running the model This is usually at canopy closure (Wolf)

weather

data.table, formatted with format_weather

cultivar_sus

numeric, susceptibility of the cultivar on the 'bsa' https://www.bundessortenamt.de variety list. Susceptibility rating must range between 1 and 9. 1 = resistant, 9 = susceptible. Default is 5.

Value

If the input weather is conducive for epidemic, the function returns a POSIX_ct date when epidemic commences. If no epidemic occurs, a numeric, proportion indicating the progress an epidemic is returned

Examples

wethr <- read.csv(system.file("extdata", "clean_weather.csv",
                  package = "cercospoRa"))
wethr <- format_weather(wethr,time_zone = "UTC")

calc_epidemic_onset(start = as.POSIXct("2022-04-25",tz = "UTC"),
                    end = as.POSIXct("2022-09-30",tz = "UTC"),
                    c_closure = as.POSIXct("2022-07-01",tz = "UTC"),
                    weather = wethr)
#> [1] "2022-07-26 UTC"