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 source
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
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")
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"))
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"))
airquality |>ggplot(aes(Month,Ozone, fill=Month)) +labs(x ="Months from May through September", y ="Concentration of Ozone", title ="Side-by-Side Boxplot of Monthly Ozones from May to September, 1973",caption ="New York State Department of Conservation and the National Weather Service",) +geom_boxplot() +scale_fill_viridis_d(name ="Month", labels =c("May", "June","July", "August", "September"))
Warning: Removed 37 rows containing non-finite outside the scale range
(`stat_boxplot()`).
###" Brief Essay: The plot that I created was a boxplot, similar to the practice plots 3-4 in the rpubs tutorial. The plot was used to compare the distributions of ozone concentrations from May to September. The varaibles that were used were Ozone, and Months from the New York state Department of Conservation and the National Weather Service data that was provided by the professor. A boxoplot graph contains IQR (Inter Quartile Ranger), which is helpful because it gives us a better visualization of the median which is the line inside the box, Q1 Percentiles, Q3 Percentiles. This is helpful to understand the difference ozone concentrations in each month. The insights that the boxplot gives us is the increase in ozone concentration from may to august, Ozone concentrations decrease in September. Given from the data, August displays the highest outlier and the highest median. I didn't use any special code for this plot because I'm inexperienced in R coding so my knowledge is very minimal. Although I was exploring the Scale_fill, to change the color of the plot."