Interactive air quality data

Brian Tellez
1/12/2020

About the project

The project consists in the airquality dataset divided in three different plots that stablish the variable Ozone as the princpal and dependent data to other three factors, that are:

  • Wind
  • Solar radiation
  • Temperature

Other than these three factors, months and days are also part of the relation of the plots. Although these variables are used to change the output from the plots.

Getting to know the dataset

head(airquality)
  Ozone Solar.R Wind Temp Month Day
1    41     190  7.4   67     5   1
2    36     118  8.0   72     5   2
3    12     149 12.6   74     5   3
4    18     313 11.5   62     5   4
5    NA      NA 14.3   56     5   5
6    28      NA 14.9   66     5   6

As shown above, the dataset contains six variables: Ozone, Solar.R (Solar radiation), Wind, Temp (Temperature), Month, Day.

Base code of the plots

For this preview, there will be a code that would show the three datasets with no filters to get a general view of how the plots would look.

par(mfrow = c(1, 3), mar = c(4, 4, 2, 1), oma = c(0, 0, 2, 0))
with(airquality, {
    plot(Wind, Ozone, main = "Ozone and Wind")
    abline(lm(Ozone ~ Wind))
    plot(Solar.R, Ozone, main = "Ozone and Solar Radiation")
    abline(lm(Ozone ~ Solar.R))
    plot(Temp, Ozone, main = "Ozone and Temperature")
    abline(lm(Ozone ~ Temp))
})

Plotting

plot of chunk unnamed-chunk-3