library(aire)

Download data

se2015 <- get_daily_data(province = "se", from = "2015-01-01", to = "2015-12-31")
# NB: downloading a whole year takes a while... ca. 20 minutes

save(se2015, file = "data/se2015.rda")

Load data

load("data/se2015.rda")
head(se2015)
##   Provincia Municipio    site      Direccion                date SO2 PART
## 1   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 00:10:00  11   NA
## 2   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 00:20:00  12   NA
## 3   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 00:30:00  14   NA
## 4   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 00:40:00  15   NA
## 5   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 00:50:00  14   NA
## 6   SEVILLA   SEVILLA RANILLA Avd. ANDALUCIA 2015-01-01 01:00:00  16   NA
##   NO2  CO O3 SH2
## 1  23 158 NA  NA
## 2  25 195 NA  NA
## 3  30 207 NA  NA
## 4  36 265 NA  NA
## 5  43 264 NA  NA
## 6  44 370 NA  NA

Now analyse with openair package

library(openair)

summaryPlot

summaryPlot(se2015, pollutant = "SO2")
##   Provincia   Municipio        site   Direccion       date1       date2 
## "character" "character"    "factor" "character"   "POSIXct"    "POSIXt" 
##         SO2        PART         NO2          CO          O3         SH2 
##   "integer"   "integer"   "integer"   "integer"   "integer"   "logical"

summaryPlot(se2015, pollutant = "O3")
##   Provincia   Municipio        site   Direccion       date1       date2 
## "character" "character"    "factor" "character"   "POSIXct"    "POSIXt" 
##         SO2        PART         NO2          CO          O3         SH2 
##   "integer"   "integer"   "integer"   "integer"   "integer"   "logical"

summaryPlot(se2015[se2015$site == "TORNEO", ])
##   Provincia   Municipio        site   Direccion       date1       date2 
## "character" "character"    "factor" "character"   "POSIXct"    "POSIXt" 
##         SO2        PART         NO2          CO          O3         SH2 
##   "integer"   "integer"   "integer"   "integer"   "integer"   "logical"

timePlot

timePlot(se2015[se2015$site == "TORNEO", ], pollutant = c("SO2", "NO2", "O3"))

calendarPlot

calendarPlot(se2015[se2015$site == "TORNEO", ], pollutant = "O3")

GoogleMapsPlot

Let’s map data for e.g. 2015-05-08. First we download the data, and merge it with info on stations location:

may8 <- get_daily_data("2015-05-08", province = "se")
data(stations)
may8sp <- merge(may8, stations[, "site"], by = "site", all.x = TRUE)

Now make the map:

GoogleMapsPlot(may8sp, pollutant = "NO2")  # experimental yet, may give problems