knitr::opts_chunk$set(echo = TRUE, message = FALSE) knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file()) library(tidyverse) library(readxl) library(cvpiaHabitat) library(scales)
[Future data improvement bullets]
Data Source:
[???--combo of mokelunme and calaveras]
There is no habitat modeling, using mokelumne and calaveras
Instream spawning and rearing habitat for Fall Run Chinook Salmon in the Cosumnes River is based on data from [data source description]. The [DWR FERC instream spawning and rearing habitat data] was provided by Mark Gard from the U.S. Fish and Wildlife Service in a spreadsheet (see '~/cvpiaHabitat/data-raw/mark_gard_data/IFIMWUA.xlsx').
# # cosumnes ----- # region <- cvpiaHabitat::modeling_exist %>% # filter(Region == 'South Delta') %>% # select(Watershed, Region, FR_fry, FR_juv) # # flows <- seq(100, 1000, by = 100) # # # spawn # cal_st_spwn <- approx(calaveras_river_instream$flow_cfs, # calaveras_river_instream$ST_spawn_wua, # rule = 2, xout = flows)$y # # mok_fr_spwn <- approx(mokelumne_river_instream$flow_cfs, # mokelumne_river_instream$FR_spawn_wua, # rule = 2, xout = flows)$y # # cos_spwn <- (cal_st_spwn + mok_fr_spwn) / 2 # # # fry # cal_st_fry <- approx(calaveras_river_instream$flow_cfs, # calaveras_river_instream$ST_fry_wua, # rule = 2, xout = flows)$y # # mok_fr_fry <- approx(mokelumne_river_instream$flow_cfs, # mokelumne_river_instream$FR_fry_wua, # rule = 2, xout = flows)$y # # cos_fry <- (cal_st_fry + mok_fr_fry) / 2 # # # juv # cal_st_juv <- approx(calaveras_river_instream$flow_cfs, # calaveras_river_instream$ST_juv_wua, # rule = 2, xout = flows)$y # # mok_fr_juv <- approx(mokelumne_river_instream$flow_cfs, # mokelumne_river_instream$FR_juv_wua, # rule = 2, xout = flows)$y # # cos_juv <- (cal_st_juv + mok_fr_juv) / 2 # # # # cosumnes_river_instream <- tibble(flow_cfs = flows, FR_spawn_wua = cos_spwn, # FR_fry_wua = cos_fry, FR_juv_wua = cos_juv, # watershed = 'Cosumnes River') # # cosumnes_river_instream # devtools::use_data(cosumnes_river_instream, overwrite = TRUE)
[description]
The following plot shows the weighted usable spawning area in square feet per thousand feet of river for Fall Run Chinook Salmon. These area per length rates are multiplied by the total spawning reach length mapped by the SIT.
``` {r,echo=FALSE} cosumnes_river_instream %>% filter(!is.na(FR_spawn_wua)) %>% ggplot(aes(x = flow_cfs , y = FR_spawn_wua)) + geom_line(color= '#7570b3') + labs(x = 'Flow (cfs)', y = 'WUA (sqft/1000ft)') + theme_minimal()
### Rearing WUA The fry and juvenile instream rearing habitat weighted usable areas for Fall Run Chinook Salmon in the Consumnes River are provided by Mark Gard (see '~/cvpiaHabitat/data-raw/mark_gard_data/IFIMWUA.xlsx'). #### Rearing WUA Plot The following plot shows the weighted usable rearing area in square feet per thousand feet of river for Fall Run Chinook Salmon fry and juvenile. These rates are multiplied by the total rearing reach length mapped by the SIT. ``` {r,echo=FALSE} cosumnes_river_instream %>% gather(Lifestage, wua, -flow_cfs, -watershed) %>% filter(!is.na(wua), Lifestage != 'FR_spawn_wua') %>% mutate(Lifestage = ifelse(Lifestage == 'FR_fry_wua', 'Fry', 'Juvenile')) %>% ggplot(aes(x = flow_cfs , y = wua, color = Lifestage)) + geom_line() + labs(x = 'Flow (cfs)', y = 'WUA (sqft/1000ft)') + theme_minimal() + scale_color_manual(values = c('#d95f02','#7570b3'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.