p1 <- airquality |>ggplot(aes(x=Temp, fill=Month)) +geom_histogram(position="identity")+scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September")) +labs(x ="Monthly Temperatures from May - Sept", y ="Frequency of Temps",title ="Histogram of Monthly Temperatures from May - Sept, 1973",caption ="New York State Department of Conservation and the National Weather Service") #provide the data sourcep1
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
p2 <- airquality |>ggplot(aes(x=Temp, fill=Month)) +geom_histogram(position="identity", alpha=0.5, binwidth =5, color ="white")+scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September")) +labs(x ="Monthly Temperatures from May - Sept", y ="Frequency of Temps",title ="Histogram of Monthly Temperatures from May - Sept, 1973",caption ="New York State Department of Conservation and the National Weather Service")p2
p3 <- airquality |>ggplot(aes(Month, Temp, fill = Month)) +labs(x ="Months from May through September", y ="Temperatures", title ="Side-by-Side Boxplot of Monthly Temperatures",caption ="New York State Department of Conservation and the National Weather Service") +geom_boxplot() +scale_fill_discrete(name ="Month", labels =c("May", "June","July", "August", "September"))p3
p4 <- airquality |>ggplot(aes(Month, Temp, fill = Month)) +labs(x ="Monthly Temperatures", y ="Temperatures", title ="Side-by-Side Boxplot of Monthly Temperatures",caption ="New York State Department of Conservation and the National Weather Service") +geom_boxplot()+scale_fill_grey(name ="Month", labels =c("May", "June","July", "August", "September"))p4
p5 <-ggplot(airquality, aes(x = Day, y = Wind, color = Month)) +geom_jitter(width =0.2, height =0, alpha =0.6) +# Used ChatGPT for Assistancefacet_wrap(~Month, scales ="free_x") +# Used ChatGPT for Assistancelabs(x ="Day of the Month", y ="Wind Speed",title ="Wind Speeds by Day and Month",caption ="New York State Department of Conservation and the National Weather Service") +theme_classic()p5
#I wanted to make a dot plot that showed wind everyday by month, after experimenting I realized I didn't know how to make an extra split by month so I used ChatGPT for the 2 lines which are marked as so. I feel this is too much AI so I will make another plot but I wanted to get this one done and include it.
p6 <- airquality |>ggplot(aes(x= Day, y = Solar.R, color = Month))+geom_point()+labs(x ="Day of the Month", y ="Solar Rating",title ="Solar Rating by Day and Month",caption ="New York State Department of Conservation and the National Weather Service") +theme_bw()p6
Warning: Removed 7 rows containing missing values or values outside the scale range
(`geom_point()`).
I created a scatter plot showing the Solar Rating of every day of the month. The Solar Rating is placed on the y-axis, and is categorized by month using color. The plot shows the highest and lowest Solar Ratings, as well as showing the wide variety of ratings throughout a month. The colors show general trends, and example being seen in June, with the first half of June trending high solar ratings, and those ratings significantly lowering for the second half. The code is fairly simple, I separated Y and color because the Y values would be of varying colors, and I used the bw theme for the colors.