I made two small corrections to the code and after that the code gives no longer an error (but warnings appear in the code):
- because you use the pipe (
%>%) I inserted library(magrittr). You probably used it already (otherwise a different error would have appeared).
- I removed the
+ characters in front of the lines. A continuation of ggplot statements must be coded with + characters at the end of each 'command'. E.g. after ggplot.
It is confusing that in the console window continued statements get + in front of them. But do not code these. Below I show your code with the corrections in a reprex. In the reprex output the front + characters are not shown.
library(ggplot2)
library(magrittr)
## Plot 1
p1 <- qplot(data = airquality,Temp,fill = Month,geom = "histogram", bins = 20)
p1

##Plot 2
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"))
p2

## Plot 3
p3 <- airquality %>%
ggplot(aes(Month, Temp, fill = Month)) +
ggtitle("Temperatures") +
xlab("Months") +
ylab("Frequency") +
geom_boxplot() +
scale_fill_discrete(name = "Month", labels = c("May", "June","July", "August", "September"))
p3
#> Warning: Continuous x aesthetic -- did you forget aes(group=...)?

## Plot 4
p4 <- airquality %>%
ggplot(aes(Month, Temp, fill = Month)) +
ggtitle("Temperatures") +
xlab("Temperatures") +
ylab("Frequency") +
geom_boxplot()+
scale_fill_grey(name = "Month", labels = c("May", "June","July", "August", "September"))
p4
#> Warning: Continuous x aesthetic -- did you forget aes(group=...)?

## Plot 5
p5 <- qplot(data = airquality,Ozone,fill = Month,geom = "histogram", bins = 20)
p5
#> Warning: Removed 37 rows containing non-finite values (stat_bin).

Created on 2020-06-15 by the reprex package (v0.3.0)