---
title: "iemiscdata: Weighted CN Calculations Using the Composite CN"
date: today
date-format: D MMMM YYYY  
author:
  - name: Irucka Embry
    affiliation: 
      - name: EcoC&sup2;S
        city: Nashville
        state: TN
        url: https://www.ecoccs.com
    degrees:
      - EIT
      - ME
lang: en-US
dir: ltr
format:
  pdf:
    pdf-standard: a-3u
    toc: true
    toc-title: Table of Contents
    papersize: letter
    margin-left: 0.79in
    margin-right: 0.79in
    mainfont: FreeSerif
    sansfont: FreeSans
    monofont: FreeMono
    code-line-numbers: true
    syntax-highlighting: kate
    colorlinks: true
    fontsize: 12pt
    author-meta: "Irucka Embry, Eco-Creative Consulting Services, EcoC^2^S" 
vignette: >
  %\VignetteIndexEntry{iemiscdata Weighted CN Calculations Using the Composite CN}
  %\VignetteEngine{quarto::pdf}
  %\VignetteEncoding{UTF-8}
---

\bigskip

# Example 2-1 from the Reference

&ldquo;The watershed covers 250 acres in Dyer County, northwestern Tennessee. Seventy percent (175 acres) is a Loring soil, which is in hydrologic soil group C. Thirty percent (75 acres) is a Memphis soil, which is in group B. The event is a 25-year frequency, 24-hour storm with total rainfall of 6 inches.&rdquo;  

&ldquo;The present cover type is pasture in good hydrologic condition.&rdquo;  

What is the present weighted CN?  

\medskip

```{r}
#| warning: false
#| message: false
#| tidy: true

install.load::load_package("iemiscdata", "iemisc", "round", "data.table")
# load needed packages using the load_package function from the install.load package (it is assumed that you have already installed these packages)

data(cn_other_agricultural, package = "iemiscdata")

# locate the row where "Hydrologic condition" == "Good" & "Cover type" %like% "Pasture, grassland, or range--continuous forage for grazing"
CNlocation1 <- cn_other_agricultural[cn_other_agricultural$"Hydrologic condition" == "Good" &
cn_other_agricultural$"Cover type" %like% "Pasture, grassland, or range--continuous forage for grazing"]

CN1 <- CNlocation1$"Curve numbers for hydrologic soil group C"

CN1



# locate the row where "Hydrologic condition" == "Good" & "Cover type" %like% "Pasture, grassland, or range--continuous forage for grazing"
CNlocation2 <- cn_other_agricultural[cn_other_agricultural$"Hydrologic condition" == "Good" &
cn_other_agricultural$"Cover type" %like% "Pasture, grassland, or range--continuous forage for grazing"]

CN2 <- CNlocation2$"Curve numbers for hydrologic soil group B"

CN2



CNa <- c(CN1, CN2)

area_pct1 <- c(0.70, 0.30)
weighted_CN(CN = CNa, area_pct = area_pct1)
```

Use a CN of `r round::round_r3(weighted_CN(CN = CNa, area_pct = area_pct1), d = 0)`.  

\bigskip
\bigskip

# Example 2-2 from the Reference

&ldquo;Seventy percent (175 acres) of the watershed, consisting of all the Memphis soil and 100 acres of the Loring soil, is 1/2-acre residential lots with lawns in good hydrologic condition. The rest of the watershed is scattered open space in good hydrologic condition.&rdquo;   

Assume 25% average impervious area.  

What is the proposed weighted CN?  

\medskip

```{r}
#| warning: false
#| message: false
#| tidy: true

data(cn_urban, package = "iemiscdata")

# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation1 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN1 <- CNlocation1$"Curve numbers for hydrologic soil group B"

CN1




# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation2 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN2 <- CNlocation2$"Curve numbers for hydrologic soil group C"

CN2



# locate the row where "Cover type and hydrologic condition" == "Good condition (grass cover > 75%)"
CNlocation3 <- cn_urban[cn_urban$"Cover type and hydrologic condition" ==
"Good condition (grass cover > 75%)", ]


CN3 <- CNlocation3$"Curve numbers for hydrologic soil group C"

CN3



CNb <- c(CN1, CN2, CN3)

area_pct2 <- c(0.30, 0.40, 0.30)
weighted_CN(CN = CNb, area_pct = area_pct2)
```

Use a CN of `r round::round_r3(weighted_CN(CN = CNb, area_pct = area_pct2), d = 0)`.  

\bigskip
\bigskip

# Example 2-3 from the Reference

&ldquo;This example is the same as example 2-2, except that the 1/2-acre lots have a total impervious area of 35 percent. For these lots, the pervious area is lawns in good hydrologic condition. Since the impervious area percentage differs from the percentage assumed in table 2-2, use figure 2-3 to compute CN.&rdquo;   

What is the proposed weighted CN?  

\medskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation1 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN1 <- CNlocation1$"Curve numbers for hydrologic soil group B"

CN1


# obtain the composite CN at 35%
CN1_new <- c_composite_CN(CN1, impervious = 35)

CN1_new



# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation2 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN2 <- CNlocation2$"Curve numbers for hydrologic soil group C"

CN2


# obtain the composite CN at 35%
CN2_new <- c_composite_CN(CN2, impervious = 35)

CN2_new



# locate the row where "Cover type and hydrologic condition" == "Good condition (grass cover > 75%)"
CNlocation3 <- cn_urban[cn_urban$"Cover type and hydrologic condition" ==
"Good condition (grass cover > 75%)", ]


CN3 <- CNlocation3$"Curve numbers for hydrologic soil group C"

CN3



CNc <- c(CN1_new, CN2_new, CN3)

area_pct3 <- c(0.30, 0.40, 0.30)
weighted_CN(CN = CNc, area_pct = area_pct3)
```

Use a CN of `r round::round_r3(weighted_CN(CN = CNc, area_pct = area_pct3), d = 0)`.  

\bigskip
\bigskip

# Example 2-4 from the Reference

&ldquo;This example is also based on example 2-2, except that 50 percent of the impervious area associated with the 1/2-acre lots on the Loring soil is “unconnected,” that is, it is not directly connected to the drainage system. For these lots, the pervious area CN (lawn, good condition) is 74 and the impervious area is 25 percent. Use figure 2-4 to compute the CN for these lots. CN's for the 1/2-acre lots on Memphis soil and the open space on Loring soil are the same as those in example 2-2. (See figure 2-8.)&rdquo;   

What is the proposed weighted CN?  

\medskip

```{r}
#| warning: false
#| message: false
#| tidy: true

# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation1 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN1 <- CNlocation1$"Curve numbers for hydrologic soil group B"

CN1




# locate the row where "Cover type and hydrologic condition" == "1/2 acre"
CNlocation2 <- cn_urban[cn_urban$"Cover type and hydrologic condition" == "1/2 acre", ]


CN2 <- CNlocation2$"Curve numbers for hydrologic soil group C"

CN2


# obtain the composite CN at 25%
CN2_new <- uc_composite_CN(CN2, impervious = 25, R = 50 / 100)

CN2_new




# locate the row where "Cover type and hydrologic condition" == "Good condition (grass cover > 75%)"
CNlocation3 <- cn_urban[cn_urban$"Cover type and hydrologic condition" ==
"Good condition (grass cover > 75%)", ]


CN3 <- CNlocation3$"Curve numbers for hydrologic soil group C"

CN3



CNc <- c(CN1, CN2_new, CN3)

area_pct4 <- c(0.30, 0.40, 0.30)
weighted_CN(CN = CNc, area_pct = area_pct4)
```

Use a CN of `r round::round_r3(weighted_CN(CN = CNc, area_pct = area_pct4), d = 0)`.  

\bigskip
\bigskip
\bigskip
\bigskip

# Works Cited

United States Department of Agriculture Natural Resources Conservation Service Conservation Engineering Division, &ldquo;Urban Hydrology for Small Watersheds Technical Release 55 (TR-55),&rdquo; June 1986, Pages 2-11 - 2-16, <https://web.archive.org/web/20230810204711/https://directives.sc.egov.usda.gov/OpenNonWebContent.aspx?content=22162.wba> [Recovered with the Internet Archive: Wayback Machine]  

\bigskip
\bigskip

# EcoC^2^S Links

EcoC^2^S Home --- <https://www.ecoccs.com>  
About EcoC^2^S --- <https://www.ecoccs.com/about-ecoc2s.html>  
Services --- <https://www.ecoccs.com/services.html>  
EcoC²S / QUP Shop --- <https://www.ecoccs.com/shopeq/>  
Media --- <https://www.ecoccs.com/media.html>  
Book Search --- <https://www.ecoccs.com/book-search.html>  
R Trainings and Resources provided by EcoC^2^S (Irucka Embry, EIT) --- <https://www.ecoccs.com/rtraining.html>  

\bigskip
\bigskip

# Donations accepted with Liberapay

If you would like to contribute to the continued development of [Irucka Embry&#8217;s R packages](https://www.ecoccs.com/rtraining.html#repos) and/or [Irucka Embry&#8217;s R Examples](https://www.ecoccs.com/rtraining.html#examp), please feel free to donate via the link below:  

[https://liberapay.com/iaembry/donate](https://liberapay.com/iaembry/donate)  

Please feel free to review [Irucka Embry (iaembry)&#8217;s profile](https://liberapay.com/iaembry/) on [Liberapay](https://liberapay.com).  

\bigskip
\bigskip

# Copyright and License

All R code written by Irucka Embry is distributed under the GPL-3 (or later) license, see the [GNU General Public License {GPL} page](https://www.gnu.org/licenses/gpl-3.0.html).  

All written content originally created by Irucka Embry is copyrighted under the Creative Commons Attribution-ShareAlike 4.0 International license. All other written content retains the copyright of the original author(s).  

This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International license](https://creativecommons.org/licenses/by-sa/4.0/).  
