Question: To create a new data frame that includes flights headed to SFO in February, we first need to filter the flights data frame using the

To create a new data frame that includes flights headed to SFO in February, we first need to filter the flights data frame using the following criteria:
- Destination airport is SFO
- Flights take place in February
We can use the filter() function from the dplyr package to achieve this.
The code would look like this:
```r
library(dplyr)
sfo_feb_flights <- filter(flights, month ==2, dest == "SFO")
```
This code creates a new data frame called sfo_feb_flights that includes flights headed to SFO in February.
To determine how many flights meet these criteria, we can use the nrow() function to count the number of rows in sfo_feb_flights:
```r
nrow(sfo_feb_flights)
```
This returns the number of rows (i.e., the number of flights) in sfo_feb_flights, which is **2286**.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!