Are you a plant disease epidemiologist? If yes, you probably need to calculate leaf wetness duration using empirical methods. One way to estimate leaf wetness duration is with classification and regression tree method (CART). Learn how to calculate in R!
Let’s generate the dummy weather data and work through it. You can find the equation and procedure of CART method of leaf wetness estimation in this link: https://doi.org/10.1094/PDIS.2002.86.2.179
Average_temperature <- sample(2:25, 20, replace=TRUE)
Dew_Point_Depression <- sample(0.5:5, 20, replace=TRUE)
Relative_Humidity <- sample(55:99, 20, replace=TRUE)
Windspeed <- sample(1.5:6, 20, replace=TRUE)
data <- data.frame(Average_temperature, Dew_Point_Depression, Relative_Humidity, Windspeed)
names(data)[1:4] <- c('tair', 'dpd', 'rh', 'wspeed')
head(data, 10)
## tair dpd rh wspeed
## 1 19 4.5 77 2.5
## 2 10 0.5 62 3.5
## 3 9 0.5 81 2.5
## 4 4 2.5 77 4.5
## 5 14 4.5 98 3.5
## 6 13 4.5 69 5.5
## 7 20 1.5 63 3.5
## 8 8 3.5 81 3.5
## 9 4 0.5 64 5.5
## 10 5 1.5 97 4.5
#Use equations for CART method of leaf wetness estimation
wetdry <- numeric(dim(data)[1])
for (i in 1:length(wetdry)) {
c1 <- 1.6064 * sqrt(data$tair[i]) + 0.0036 * data$tair[i]^2 +
0.1531 * data$rh[i] - 0.4599 * data$wspeed[i] * data$dpd[i] - 0.0035 * data$tair[i] * data$rh[i]
c2 <- 0.7921 * sqrt(data$tair[i]) + 0.0046 * data$rh[i] - 2.3889 * data$wspeed[i] -
0.0390 * data$tair[i] * data$wspeed[i] + 1.0613 * data$wspeed[i] * data$dpd[i]
if (data$dpd[i] >= 3.7) {
wetdry[i] <- 'D'
} else if (data$wspeed[i] < 2.5 & c1 > 14.4674) {
wetdry[i] <- 'W'
} else if (data$wspeed[i] < 2.5 & c1 <= 14.4674) {
wetdry[i] <- 'D'
} else if (data$rh[i] >= 87.8 & c2 > 37.0) {
wetdry[i] <- 'W'
} else {
wetdry[i] <- 'D'
}
}
wetdry
## [1] "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D" "D"
## [20] "D"