Skip to content

Commit

Permalink
case study 4
Browse files Browse the repository at this point in the history
  • Loading branch information
embyrne0 committed Nov 25, 2024
1 parent 61ce0f9 commit eb1f1c0
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions week_04/case_study_04.Rmd
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
---
title: "Case Study 04"
author: Your Name
author: Eleanor M. Byrne
date: August 1, 2020
output: github_document
---

## First Header
## Packages/Lib

Comments

```{r}
summary(cars)
# This is for library/packages
# install/load packages
library(tidyverse)
# install.packages('nycflights13')
library(nycflights13)
library(dplyr)
```

## Second Header
## Opening/Data/information

Comments
```{r}
# Open and access the nyc flights
airports <- nycflights13::airports
flights <- nycflights13::flights
```

```{r}
# Find the maximum distance and the corresponding destination airport code
highest <- flights %>%
arrange(desc(distance)) %>%
slice(1) %>%
select(dest, distance)
# It would be HNL (dest)
```

```{r}
# Join with airports data to get the full name of the airport
farthest_airport_data <- highest %>%
left_join(airports, by = c("dest" = "faa")) %>%
select(name) # select the the destName column only
```

```{r}
plot(pressure)
# Convert the data.frame to a single character value with as.character()
farthest_airport <- as.character(farthest_airport_data$name)
# Print the farthest airport name
farthest_airport
```

0 comments on commit eb1f1c0

Please sign in to comment.