<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>CART method on Bhim Chaulagain</title><link>https://bhimchaulagain.netlify.app/tags/cart-method/</link><description>Recent content in CART method on Bhim Chaulagain</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>B. Chaulagain {year}</copyright><lastBuildDate>Mon, 08 Jun 2020 21:13:14 -0500</lastBuildDate><atom:link href="https://bhimchaulagain.netlify.app/tags/cart-method/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Estimate Leaf Wetness Duration (LWD) Using the CART Method in R</title><link>https://bhimchaulagain.netlify.app/post/2019-01-23-lwd-caclculation/</link><pubDate>Mon, 08 Jun 2020 21:13:14 -0500</pubDate><guid>https://bhimchaulagain.netlify.app/post/2019-01-23-lwd-caclculation/</guid><description>&lt;p>Leaf wetness duration (LWD) is a critical environmental variable in plant disease epidemiology and is widely used in disease forecasting and risk assessment models. Among the available empirical approaches, the Classification and Regression Tree (CART) method provides a practical framework for estimating LWD from standard weather observations.&lt;/p>
&lt;p>In this post, I demonstrate how to estimate leaf wetness duration in R using the CART approach, including data preparation, implementation steps, and interpretation of outputs for plant disease applications.&lt;/p>
&lt;p>If you want to connect leaf wetness duration to a full infection-risk workflow, see &lt;a href="https://bhimchaulagain.netlify.app/post/2023-02-01-generic_infection_risks/">How to Code the Magarey Generic Infection Model for Foliar Fungal Plant Pathogens in Python&lt;/a>.&lt;/p>
&lt;p>Let&amp;rsquo;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: &lt;a href="https://doi.org/10.1094/PDIS.2002.86.2.179">https://doi.org/10.1094/PDIS.2002.86.2.179&lt;/a>&lt;/p>
&lt;pre>&lt;code class="language-r">Average_temperature &amp;lt;- sample(2:25, 20, replace=TRUE)
Dew_Point_Depression &amp;lt;- sample(0.5:5, 20, replace=TRUE)
Relative_Humidity &amp;lt;- sample(55:99, 20, replace=TRUE)
Windspeed &amp;lt;- sample(1.5:6, 20, replace=TRUE)
data &amp;lt;- data.frame(Average_temperature, Dew_Point_Depression, Relative_Humidity, Windspeed)
names(data)[1:4] &amp;lt;- c('tair', 'dpd', 'rh', 'wspeed')
head(data, 10)
#Use equations for CART method of leaf wetness estimation
wetdry &amp;lt;- numeric(dim(data)[1])
for (i in 1:length(wetdry)) {
c1 &amp;lt;- 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 &amp;lt;- 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] &amp;gt;= 3.7) {
wetdry[i] &amp;lt;- 'D'
} else if (data$wspeed[i] &amp;lt; 2.5 &amp;amp; c1 &amp;gt; 14.4674) {
wetdry[i] &amp;lt;- 'W'
} else if (data$wspeed[i] &amp;lt; 2.5 &amp;amp; c1 &amp;lt;= 14.4674) {
wetdry[i] &amp;lt;- 'D'
} else if (data$rh[i] &amp;gt;= 87.8 &amp;amp; c2 &amp;gt; 37.0) {
wetdry[i] &amp;lt;- 'W'
} else {
wetdry[i] &amp;lt;- 'D'
}
}
wetdry
&lt;/code>&lt;/pre></description></item></channel></rss>