We need a FAQ: How to do a minimal reproducible example ( reprex ) for beginners
The code you have supplied is good but would be useful to see all the code and to see some sample data. A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need.
One thing I did notice is that you are using group_by()
and then dplyr::summarise
. group_by
is in the *dyplyr pagkage as is summarise
. Have you loaded dplyer using a library(dplyr)
command?