p1 <- airquality1 |>ggplot(aes(x=Temp, fill=month_name)) +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 p1
`stat_bin()` using `bins = 30`. Pick better value `binwidth`.
Plot 2
p2 <- airquality1 |>ggplot(aes(x=Temp, fill=month_name)) +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
p3 <- airquality1 |>ggplot(aes(Month, Temp, fill = month_name)) +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
p4 <- airquality1 |>ggplot(aes(Month, Temp, fill = month_name)) +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
Plot 5
p5 <- airquality1 |>ggplot(aes(Month, Temp, fill = month_name)) +labs(x ="Months from April through July", y ="Temperatures", title ="Dot Plot of Monthly Temperatures",caption ="National Weather Service") +geom_dotplot(binaxis ="y", stackdir ="center") +scale_fill_grey(name ="Month", labels =c("May", "June", "July", "August", "September"))p5
Bin width defaults to 1/30 of the range of the data. Pick better value with
`binwidth`.