# This R script makes a csv of descriptive statistics



setwd("C:/Andrea/Projects/MDE/MS4_Data_Analysis/4MS4_Geomorph/Reports/3_Report/DescriptiveStats")

#Descriptive statistics 3 Locations & 3 parameters
GeoPar.df <- read.csv("GeoPar.csv", na="empty")
GPAR <-GeoPar.df$Value
GPARStat <-function(GPAR){c(length(GPAR),summary(GPAR), sd(GPAR),c(quantile(GPAR, c(0.1, 0.9))))}
ag_GeoPar<-aggregate(GPAR ~ County + Xsec +Parameter,data = GeoPar.df,GPARStat)
write.csv(ag_GeoPar,"GeoPar_Stats.csv")

