- For this homework, I used a dataset on Air Quality from the UCI Archives.
- Specifically, the dataset contains the levels of different contaminants in the air in an Italian city such as:
- Carbon Monoxide, Non-metallic Hydrocarbons, Benzene, etc.
library(plotly)
## Loading required package: ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(ggplot2)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
airq <- read.csv("AirQualityUCI.csv", sep=";", dec=",")
airq$Date_Objects <- as.Date(airq$Date, format="%m/%d/%Y")
head(airq)
## Date Time CO.GT. PT08.S1.CO. NMHC.GT. C6H6.GT. PT08.S2.NMHC.
## 1 10/03/2004 18.00.00 2.6 1360 150 11.9 1046
## 2 10/03/2004 19.00.00 2.0 1292 112 9.4 955
## 3 10/03/2004 20.00.00 2.2 1402 88 9.0 939
## 4 10/03/2004 21.00.00 2.2 1376 80 9.2 948
## 5 10/03/2004 22.00.00 1.6 1272 51 6.5 836
## 6 10/03/2004 23.00.00 1.2 1197 38 4.7 750
## NOx.GT. PT08.S3.NOx. NO2.GT. PT08.S4.NO2. PT08.S5.O3. T RH AH X X.1
## 1 166 1056 113 1692 1268 13.6 48.9 0.7578 NA NA
## 2 103 1174 92 1559 972 13.3 47.7 0.7255 NA NA
## 3 131 1140 114 1555 1074 11.9 54.0 0.7502 NA NA
## 4 172 1092 122 1584 1203 11.0 60.0 0.7867 NA NA
## 5 131 1205 116 1490 1110 11.2 59.6 0.7888 NA NA
## 6 89 1337 96 1393 949 11.2 59.2 0.7848 NA NA
## Date_Objects
## 1 2004-10-03
## 2 2004-10-03
## 3 2004-10-03
## 4 2004-10-03
## 5 2004-10-03
## 6 2004-10-03