Hi, I a relatively new R User. This maybe more of a data management issue than a stats issue. I have a dataset in the "vertical" format. Columns are: Name (e.g., locations, about 10 of these), Date, Parameter, Code, and Result. (I think I properly loaded a reprex of my code below)
I am trying to use summaryStats in the EnvStats package to get summary stats (mean, median, n, SD, Max, Min, etc.) for these data by Code and by Name.
I did it what i think is the hard way, filtering for Code, and doing this separately for all my Codes:
seperate_data<- LakeReduced %>% filter(Code =="sc") #> Error in LakeReduced %>% filter(Code == "sc"): could not find function "%>%" t1 <- summaryStats((Corrected) ~ Name, data=seperate_data, digits = 0) Is there a more efficient method? Do I have to convert the dataset into a "Wide" format? Thanks so much! Craig Subset of Data: Name Date Parameter Code Result Channel 6-Mar-20 Secchi Disk sd 0.4 Channel 6-Mar-20 Total Depth td 0.9 Channel 6-Mar-20 Temperature temp 20.2 Channel 6-Mar-20 Dissolved Oxygen (%) do% 36.1 Channel 6-Mar-20 Dissolved Oxygen do 3.3 Channel 6-Mar-20 Specific Conductance sc 71 Channel 6-Mar-20 Secchi Disk sd 0.3 Channel 6-Mar-20 Total Depth td 4.1 Channel 6-Mar-20 pH ph 5.1 Channel 6-Mar-20 ORP orp 339 Channel 6-Mar-20 Temperature temp 21.3 Channel 6-Mar-20 Dissolved Oxygen (%) do% 92.3 Channel 6-Mar-20 Dissolved Oxygen do 8.2 Channel 6-Mar-20 Specific Conductance sc 66 Canal 6-Mar-20 Secchi Disk sd 0.3 Canal 6-Mar-20 Total Depth td 2.8 Canal 6-Mar-20 Temperature temp 19.8 Canal 6-Mar-20 Specific Conductance sc 72 Canal 6-Mar-20 Dissolved Oxygen (%) do% 47.7 Canal 6-Mar-20 Dissolved Oxygen do 4.4 Canal 6-Mar-20 pH ph 4.5 Canal 6-Mar-20 ORP orp 302 Hia 6-Mar-20 Secchi Disk sd 0.3 Hia 6-Mar-20 Total Depth td 3.2 Hia 6-Mar-20 Temperature temp 20.7 Hia 6-Mar-20 Specific Conductance sc 72 Hia 6-Mar-20 Dissolved Oxygen (%) do% 87.6 Hia 6-Mar-20 Dissolved Oxygen do 7.9 Hia 6-Mar-20 pH ph 5.5 Hia 6-Mar-20 ORP orp 318