# \donttest{
library(dplyr)
## Load example data:
data(AgroClimateData)
## Estimate daily PET:
PET <- calcEto(AgroClimateData, method = "PM", Zh = 10)
## Add the estimated PET 'ET.Daily' to a new column in AgroClimateData:
AgroClimateData$Eto <- PET$ET.Daily
## Estimate daily water balance for the soil having 100mm of WHC:
watBal.list <- calcWatBal(data = AgroClimateData, soilWHC = 100)
watBal <- watBal.list$data
## seasonal calendar is estimated for the onset window ranges from
## 01 September to 31 January having a soil with 100mm of WHC:
soilWHC <- 100
onsetWind.start <- "09-01"
onsetWind.end <- "01-31"
cessaWind.end <- "06-30"
seasCal.dF <- calcSeasCal(
data = watBal, onsetWind.start, onsetWind.end,
cessaWind.end, soilWHC
)
## Tercile Rainfall Probabilities of seasonal Forecast for OND, 2023:
rainTerc <- data.frame(T1 = 0.15, T2 = 0.10, T3 = 0.75)
## Summarize rainfall data for October to December:
seasRain <- AgroClimateData %>%
filter(Month %in% c(10, 11, 12)) %>%
group_by(Year) %>%
summarize(sRain = sum(Rain))
## Start of the historical resampling year
hisYearStart <- 1991
## End of the historical resampling year
hisYearEnd <- 2022
## Historical WSC Simulations:
hisWSCvar <- seasCal.dF
## WSC variable to forecast:
fcstVarName <- "Onset"
tercileMethod <- "quantiles"
SeasFcst.dF <- seasFcstQBR(
hisYearStart, hisYearEnd, rainTerc,
seasRain, hisWSCvar, fcstVarName,
tercileMethod
)
# }
Run the code above in your browser using DataLab