Read CSV into R
AirQualityData = read.csv(file="airquality.csv", header=TRUE, sep=",")
#O3 - Ozone
#NO2 - Nitrogen dioxide
#NO - Nitric oxide
#SO2 - Sulfur dioxide
#PM10 - Particulate Matter of less than 10 millionths of a metre
head(AirQualityData)
## X Ozone Solar.R Wind Temperature Month Day
## 1 1 41 190 7.4 67 5 1
## 2 2 36 118 8.0 72 5 2
## 3 3 12 149 12.6 74 5 3
## 4 4 18 313 11.5 62 5 4
## 5 5 NA NA 14.3 56 5 5
## 6 6 28 NA 14.9 66 5 6
summary(AirQualityData)
## X Ozone Solar.R Wind
## Min. : 1 Min. : 1.00 Min. : 7.0 Min. : 1.700
## 1st Qu.: 39 1st Qu.: 18.00 1st Qu.:115.8 1st Qu.: 7.400
## Median : 77 Median : 31.50 Median :205.0 Median : 9.700
## Mean : 77 Mean : 42.13 Mean :185.9 Mean : 9.958
## 3rd Qu.:115 3rd Qu.: 63.25 3rd Qu.:258.8 3rd Qu.:11.500
## Max. :153 Max. :168.00 Max. :334.0 Max. :20.700
## NA's :37 NA's :7
## Temperature Month Day
## Min. :56.00 Min. :5.000 Min. : 1.0
## 1st Qu.:72.00 1st Qu.:6.000 1st Qu.: 8.0
## Median :79.00 Median :7.000 Median :16.0
## Mean :77.88 Mean :6.993 Mean :15.8
## 3rd Qu.:85.00 3rd Qu.:8.000 3rd Qu.:23.0
## Max. :97.00 Max. :9.000 Max. :31.0
##
#install.packages(c("ggplot2","gcookbook"))
#install.packages("ggplot2")
library(ggplot2)
library(gcookbook)
#Histogram
ggplot(AirQualityData, aes(x=Temperature)) + geom_histogram(binwidth=1)

boxplot(Temperature ~ Month, xlab="Month", ylab="Temperature", data=AirQualityData)

#Scatterplot
ggplot(AirQualityData, aes(x=Temperature, y=Ozone)) + geom_point(shape=1)
## Warning: Removed 37 rows containing missing values (geom_point).
