KREW methods

Grid points are situated across two watersheds: Bull and Provinence. precipitation at Bull watershed is dominated by Snow melt while Provinence is a combination of rain and snowmelt. Each watershed contains four sections with different fire management treatments. Management practices to reduce fire severity included thinning aboveground biomass (thin), prescribed burns (burn),the combination of both (thin+burn) and no treatment (control). Soil pits were dug and depth profiles were described at multiple grid points within each treatment area. Soil samples were collected from each soil horizon within pit profile.

Soils were oven dried at 105F overnight and sieved through a 2 mm diameter mesh. Soil pH was measured by mixing 2:1 (w:w) solution to dry soil weight ratios in water and 0.05 M CaCl2. Elemental carbon and nitrogen concentrations as well as and isotopic composition (%C, %N, d13C, d15N values) were measured in the Stable Isotope Ecosystem Laboratory at the University of California, Merced (SIELO). Dried soil and o horizon samples were ground into fine powder with ball mill. Samples were weighed into tin capsules and combusted in a Costech 4010 Elemental Analyzer coupled with a Delta V Plus Continuous Flow Isotope Ratio Mass Spectrometer. The carbon and nitrogen isotope compositions were corrected for instrumental drift, mass linearity, and standardized to the international VPDB (d13C) and AIR (d15N) scales using the USGS 41A and USGS 40 standard reference materials. Elemental carbon and nitrogen content were determined via linear regression of CO2 and N2 sample gas peak areas against the known carbon and nitrogen contents of USGS 40,USGS 41a, and Costech acetanilide. All isotope compositions are expressed in standard delta notations. Plant available nutrient concentrations of major cations (Ca, Mg, K, Na) and metals (Fe, Mn, B, Zn) were determined by extracting 10g of soils with a 50 mL solution of 1M ammonium acetate pH 7 for one hour and supernant was filtered through Whatman no 42. Concentration of cations were measured with a Perkin-Elmer Optima 5300 DV Inductive Coupled Plasma Optical Emission Spectrometer at the the University of California Merced Environmental Analytical Laboratory.

##Import Data

library(readxl)
library(dplyr)
library(readr)
krewdf <- read_csv("~/Desktop/KREW analysis/KREW_metadata_nutrient_compilation_2021.csv")
## Rows: 234 Columns: 44
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (28): sampleID, Watershed_type, Watershed_code, Treatment, Grid_code, Ho...
## dbl (16): Identifier_1, amount_mg, Area 28, Area 44, d13C_corrected, d15N_co...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#make sure to import the csv, the excel file keeps the values as characters
library(rmarkdown)
paged_table(krewdf, options = list(rows.print = 15))

#Plots including organic horizons ### Boxplots TC that include O horizon

library(ggplot2)
#soils with O horizon
TC_plot <- ggplot(krewdf, aes(x=Treatment,y=C_wt_percent, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="Carbon Percent (%)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))


  
TC_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

###Boxplots TN that include O horizon

library(ggplot2)
#soils with O horizon
TN_plot <- ggplot(krewdf, aes(x=Treatment,y=N_wt_percent, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="Total Nitrogen (%)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
  
TN_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

###CN plots

CN_plot <- ggplot(krewdf, aes(x=Treatment,y=`C/N`, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="C/N Ratio")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
  
CN_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

library(ggpubr)
ggarrange(TC_plot,TN_plot,CN_plot,nrow=3,common.legend = TRUE)
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

ggsave("~/Desktop/Carbon_Nitrogen_elemental_figure1.png", width = 18, height = 18, units = "cm",dpi=300)

##TC point plots by depths that include organic horizons

TCdepth<-ggplot(krewdf, aes(x=C_wt_percent,y=Depth_cm_bottom, color =Treatment))+
  labs(x="Total Carbon (%)",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  ylim(135, 0)+
  xlim(0,10)+
  scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))


TCdepth
## Warning: Removed 6 rows containing missing values or values outside the scale range
## (`geom_point()`).

#Note that we need depths of samples from T003. They are not in the site description files

##TN point plots by depths that include organic horizons

TNdepth<-ggplot(krewdf, aes(x=N_wt_percent,y=Depth_cm_bottom, color =Treatment))+
  labs(x="Total Nitrogen (%)",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  ylim(135, 0)+
  xlim(0,0.5)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))


TNdepth
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

CNdepth<-ggplot(krewdf, aes(x=`C/N`,y=Depth_cm_bottom, color =Treatment))+
  labs(x="C/N",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+ylim(135,0)+xlim(0,45)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))


CNdepth
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

ggarrange(TCdepth,TNdepth,CNdepth,nrow=3, common.legend = TRUE)
## Warning: Removed 6 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 6 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

#Plots that do not include organic horizons

colnames(krewdf)
##  [1] "Identifier_1"                    "sampleID"                       
##  [3] "Watershed_type"                  "Watershed_code"                 
##  [5] "Treatment"                       "Grid_code"                      
##  [7] "Horizon_name"                    "amount_mg"                      
##  [9] "Area 28"                         "Area 44"                        
## [11] "d13C_corrected"                  "d15N_corrected"                 
## [13] "N_wt_percent"                    "C_wt_percent"                   
## [15] "C/N"                             "Soil_sampling_date_MMDDYYYY"    
## [17] "soil_sampler_initials"           "Soil_pit_depth_cm"              
## [19] "Elevation_ft"                    "Latitude"                       
## [21] "Longitude"                       "Horizon"                        
## [23] "Depth_cm_top"                    "Depth_cm_bottom"                
## [25] "Structure_Type"                  "Structure_grade"                
## [27] "Structure_Size"                  "Texture"                        
## [29] "Color_HUE"                       "Color_Value"                    
## [31] "Color_Chroma"                    "Coarse_Fragments_kind"          
## [33] "Coarse_fragments_size"           "Coarse_fragment_roundness_class"
## [35] "Coarse_fragments_shape"          "Coarse_fragments_percent"       
## [37] "Boundary_distinctness"           "Boundary_Topography"            
## [39] "Roots_size_VF_quantity"          "Roots_size_F_quantity"          
## [41] "Roots_size_M_quantity"           "Roots_size_C_quantity"          
## [43] "Roots_size_VC_quantity"          "Notes"
#no O horizon
unique(krewdf$Horizon_name)
##  [1] "A1" "B"  "C"  "A"  "O"  "A2" "B1" "B2" "BC" "AC" "AB"
vars1 <- c("Horizon_name")
cond1 <-c("O")
krewdf_noO<-krewdf %>% filter(Horizon_name != "O")
library(rmarkdown)
paged_table(krewdf_noO, options = list(rows.print = 15))

##TC boxplots that don’t include organic horizons

TCnoO_plot <- ggplot(krewdf_noO, aes(x=Treatment,y=C_wt_percent, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="Total Carbon (%)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  facet_wrap(~Watershed_type, ncol = 2)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
TCnoO_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_TC.png", width = 18, height = 9, units = "cm",dpi=300) 

##TC point plots by depth that don’t include organic horizons

TCnoOdepth<-ggplot(krewdf_noO, aes(x=C_wt_percent,y=Depth_cm_bottom, color =Treatment))+
  labs(x="Total Carbon (%)",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  ylim(135, 0)+
  xlim(0,15)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

TCnoOdepth
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_TC_depth.png", width = 18, height = 9, units = "cm",dpi=300) 

##TN boxplots with no organic horizons

TNnoO_plot <- ggplot(krewdf_noO, aes(x=Treatment,y=N_wt_percent, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="Total Nitrogen (%)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  facet_wrap(~Watershed_type, ncol = 2)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
TNnoO_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_TN.png", width = 18, height = 9, units = "cm",dpi=300) 
CNnoO_plot <- ggplot(krewdf_noO, aes(x=Treatment,y=`C/N`, color =Treatment))+
  geom_boxplot()+
  labs(x="Treatment",y="CN ratio")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  facet_wrap(~Watershed_type, ncol = 2)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
CNnoO_plot
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_CN.png", width = 18, height = 9, units = "cm",dpi=300) 
TNnoOdepth<-ggplot(krewdf_noO, aes(x=N_wt_percent,y=Depth_cm_bottom, color =Treatment))+
  labs(x="Total Nitrogen (%)",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+ylim(135,0)+
  scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

TNnoOdepth
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_TN_depth.png", width = 18, height = 9, units = "cm",dpi=300) 
CNnoOdepth<-ggplot(krewdf_noO, aes(x=`C/N`,y=Depth_cm_bottom, color =Treatment))+
  labs(x="C/N ratio",y="Depth (cm)")+
  geom_jitter()+
  facet_wrap(~Watershed_type, ncol = 2)+
  theme_bw()+
  theme(panel.grid = element_blank(),text = element_text(size = 20))+
  theme(legend.position = "right")+
  xlim(0,45)+
  ylim(135, 0)+scale_colour_brewer(palette = "Set1")+theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

CNnoOdepth
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

#ggsave("~/Desktop/Mineral_Soil_CN_depth.png", width = 18, height = 9, units = "cm",dpi=300) 
ggarrange(TCnoO_plot,TNnoO_plot,CNnoO_plot, nrow=3, common.legend = TRUE)
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_boxplot()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).

ggsave("~/Desktop/Carbon_Nirtogen_Mineral_Soil.png", width = 18, height = 18, units = "cm",dpi=300) 
ggarrange(TCnoOdepth,TNnoOdepth,CNnoOdepth, nrow=3, common.legend = TRUE)
## Warning: Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).
## Removed 5 rows containing missing values or values outside the scale range
## (`geom_point()`).

ggsave("~/Desktop/Carbon_Nirtogen_Mineral_Soil_at_depth.png", width = 18, height = 18, units = "cm",dpi=300)