knitr::opts_chunk$set(fig.width = 7, fig.height = 7)
ascotraceR is an R package of the 'ascotraceR' model developed to simulate the spread of Ascochyta blight in a chickpea field over a growing season. Parameters and variables used in the model were mostly derived from the literature and were subjected to validation in the field. The model uses daily weather data to simulate disease spread and a set of weather data is included with the package for demonstration purposes.
Load the libraries.
library("ascotraceR") library("lubridate") library("ggplot2") library("data.table")
Import the weather data
# weather data Billa_Billa <- fread( system.file( "extdata", "2020_Billa_Billa_weather_data_ozforecast.csv", package = "ascotraceR" ) ) # format time column Billa_Billa[, local_time := dmy_hm(local_time)] # specify the station coordinates of the Billa Billa weather station Billa_Billa[, c("lat", "lon") := .(-28.1011505, 150.3307084)] head(Billa_Billa)
A function, format_weather()
, is provided to convert raw weather data into the format appropriate for the model.
It is mandatory to format weather data before running the model.
Time zone can also be set manually using time_zone
argument.
If latitude and longitude are not supplied in the raw weather data, a a separate CSV file listing latitude and longitude can be supplied to meet this requirement (see ?format_weather
for more details).
Billa_Billa <- format_weather( x = Billa_Billa, POSIXct_time = "local_time", temp = "mean_daily_temp", ws = "ws", wd_sd = "wd_sd", rain = "rain_mm", wd = "wd", station = "location", time_zone = "Australia/Brisbane", lon = "lon", lat = "lat" )
A function, trace_asco()
, is provided to simulate the spread of Ascochyta blight in a chickpea field over a growing season.
The inputs needed to run the function include weather data, paddock length and width, sowing and harvest dates, chickpea growing points replication rate, primary infection intensity, latent period, number of conidia produced per lesion and the location of primary infection foci (centre or random).
The model output is a nested list with items for each day of the model run.
See the help file for trace_asco()
for more information.
# Predict Ascochyta blight spread for the year 2020 at Billa Billa traced <- trace_asco( weather = Billa_Billa, paddock_length = 20, paddock_width = 20, initial_infection = "2020-07-17", sowing_date = "2020-06-04", harvest_date = "2020-10-27", time_zone = "Australia/Brisbane", seeding_rate = 40, gp_rr = 0.0065, spores_per_gp_per_wet_hour = 0.6, latent_period_cdd = 150, primary_inoculum_intensity = 100, primary_infection_foci = "centre" )
Functions tidy_trace()
and summarise_trace()
have been provided to tidy up and summarise the model output
tidied <- tidy_trace(traced) tidied
summarised <- summarise_trace(traced) summarised
Plot the number of infectious growing points on day 132.
ggplot(data = subset(tidied, i_day == 132), aes(x = x, y = y, fill = infectious_gp)) + geom_tile()
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.