I look at the "flights" table from the library(nycflights13)
package. I try to create a table from it that contains the number of flights per carrier per airport of origin. My initial idea was to count the number of each airline for each airport of origin.
So the table could look like this:
number of flights / carrier / origin
200-AA-JFK
147-AA-ALM (because airlines could have flown off from different airports)
etc...
Frankly, I have no idea how to approach this problem in terms of coding. I started with this simple two-liner:
flights %>%
count(carrier)
It shows me the count of each airline. Is it somehow possible to add another count criterion, such as origin, so that the function would count the number of airlines for each origin?