I'm trying to find the maximum number of flights delayed from certain origins using the library(nycflights13) and I'm not able to figure out how to group by "chr"
library(nycflights13)
library(dplyr)
flights2 <- mutate(flights,factori = as.factor(flights$origin))
flights2 %>%
filter(dep_delay > 2) %>%
select(dep_delay, factori) %>%
group_by(factori)
Sample of output:
How can I get them grouped together? How can I find the max count?