Student Information

πŸ“ Full Name: (Type your name here)
πŸ†” Student ID: (Type your ID here)


Task 01: Exploring the early_january_weather Dataset

Instructions:
- Load the necessary packages: ggplot2, dplyr, and moderndive.
- Load the early_january_weather dataset.
- Use glimpse() to examine the structure of the dataset.
- Access the dataset’s documentation.

πŸ“Œ Need help? Refer to Slides 5-6 of Lecture 11 for guidance.

library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(moderndive)

Task 02: Creating a Line Graph

Instructions

  • Create a line graph to visualize temperature changes over time.
  • Set the x-axis to time_hour and the y-axis to temp.
  • Modify the line graph by adjusting its appearance:
    • Set the color to "darkorange".
    • Change the line type to "twodash".
    • Adjust the line width to 1.2.
  • Add axis labels:
    • x-axis label: "Time (hourly)".
    • y-axis label: "Temperature (Β°F)".
  • Add plot annotations:
    • Title: "Hourly Temperature".
    • Subtitle: "EWR 2013".
  • Apply the black-and-white theme.
  • Center-align the title and subtitle.

πŸ“Œ Need help? Refer to Slides 15-16 of Lecture 11 for guidance.

ggplot(data = early_january_weather, aes(x = time_hour, y = temp)) +
  geom_line(color = "darkorange", linetype = "twodash", linewidth = 1.2) +
  labs(x = "Time (hourly)", y = "Temperature (F)",
      title = "Hourly Temperature",
      subtitle = "EWR 2013") +
  theme_bw() +
  theme(plot.title = element_text(hjust = 0.5),
        plot.subtitle = element_text(hjust = 0.5))

Task 03: Saving the Line Graph as an Image

Instructions:
- Save the last plot you created as a PNG file.
- Name the file "Final_Line_Graph.png".

πŸ“Œ Need help? Refer to Slide 19 of Lecture 11 for guidance.

# Save the line graph as an image file
ggsave("Final_Line_Graph.png")
## Saving 7 x 5 in image

Final Steps: Submitting Your Work

βœ… Save your work.
βœ… Knit your R Notebook as an HTML file.
⚠ Do NOT submit the .Rmd file.

πŸ“₯ Submission on Canvas:

Upload the following two files:

1️⃣ YourFirstName_YourLastName - In-Class Assignment 07.html
2️⃣ Final_Line_Graph.png

πŸ“Œ Double-check your files before submitting!