Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Avi Gross via R-help
some see as the opposite companion of "winterize" ... -Original Message- From: R-help On Behalf Of Rich Shepard Sent: Monday, September 13, 2021 5:51 PM To: r-help@r-project.org Subject: Re: [R] tidyverse: grouped summaries (with summerize) On Mon, 13 Sep 2021, Rich She

Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Rich Shepard
On Tue, 14 Sep 2021, Eric Berger wrote: This code is not correct: disc_by_month %>% group_by(year, month) %>% summarize(disc_by_month, vol = mean(cfs, na.rm = TRUE)) It should be: disc %>% group_by(year,month) %>% summarize(vol=mean(cfs,na.rm=TRUE) Eric/Avi: That makes no difference:

Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Eric Berger
This code is not correct: disc_by_month %>% group_by(year, month) %>% summarize(disc_by_month, vol = mean(cfs, na.rm = TRUE)) It should be: disc %>% group_by(year,month) %>% summarize(vol=mean(cfs,na.rm=TRUE) On Tue, Sep 14, 2021 at 12:51 AM Rich Shepard wrote: > On Mon, 13 Sep 2

Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Rich Shepard
On Mon, 13 Sep 2021, Rich Shepard wrote: That's what I thought I did. I'll rewrite the script and work toward the output I need. Still not the correct syntax. Command is now: disc_by_month %>% group_by(year, month) %>% summarize(disc_by_month, vol = mean(cfs, na.rm = TRUE)) and result

Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Rich Shepard
On Mon, 13 Sep 2021, Avi Gross via R-help wrote: Did I miss something? Avi, Probably not. The summarise() command is telling you that you had not implicitly grouped the data and it made a guess. The canonical way is: ... %>% group_by(year, month, day, hour) %>% summarise(...) After sendi

Re: [R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Avi Gross via R-help
ey are in the output. Avi -Original Message- From: R-help On Behalf Of Rich Shepard Sent: Monday, September 13, 2021 4:53 PM To: r-help@r-project.org Subject: [R] tidyverse: grouped summaries (with summerize) I changed the data files so the date-times are in five separate columns: year,

[R] tidyverse: grouped summaries (with summerize)

2021-09-13 Thread Rich Shepard
I changed the data files so the date-times are in five separate columns: year, month, day, hour, and minute; for example, year,month,day,hour,min,cfs 2016,03,03,12,00,149000 2016,03,03,12,10,15 2016,03,03,12,20,151000 2016,03,03,12,30,156000 2016,03,03,12,40,154000 2016,03,03,12,50,15 2016