Learn R Programming

cercospoRa (version 0.0.1)

calc_epidemic_onset: Calculate epidemic onset

Description

Calculate epidemic onset

Usage

calc_epidemic_onset(start, end, c_closure, weather, cultivar_sus = 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

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

character, susceptibility of the cultivar in "R" resistant, "S" susceptible, "MR" moderately resistant etc.

Examples

Run this code
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)

Run the code above in your browser using DataLab