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`.
Plot 2: Improve the histogram of Average Temperature by Month
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
Plot 3: Create side-by-side boxplots categorized by Month
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
Plot 4: Side by Side Boxplots in Gray Scale
p4 <- 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_grey(name ="Month", labels =c("May", "June","July", "August", "September"))p4
##Plot 5:
p5 <- airquality |>ggplot() +geom_point(data = airquality, aes(x = Month, y = Wind, fill = Month), size =3.5) +labs(x ="Months from May through September", y ="Wind", title ="Side-by-Side Boxplot of Monthly Wind",caption ="New York State Department of Conservation and the National Weather Service")p5
p5.1<- airquality |>ggplot(aes(Month, Wind, fill = Month,)) +labs(x ="Months from May through September", y ="Wind", title ="Side-by-Side Boxplot of Monthly Wind",caption ="New York State Department of Conservation and the National Weather Service") +geom_boxplot()p5.1
The main reason I chose to do this scatter plot was to explore a different type of graph, witch is a plot I am not verry costumed to , this is good just like the box plot to analyze the variance between the data, and to analyze and tell the full story of the data. I wanted to see what was the variable that most influence in the temperature, and after making this graph for all the other variables we can see that the wind is the one that makes the most difference.Being almost the complete opposite of the temperatures graph. Where we can see that the higher temperatures have a lower wind. Since its my first time using r and coding, I did something more simple , creating a similar graph but changing using geom_point and also changing the size = 3.5 to change the size of the points inside the graph.