In this vignette I want to show how easy and useful it is to use the openair package with Open AQ data.
library("ropenaq")
library("openair")
library("dplyr")
measurementsNL <- aq_measurements(location="Amsterdam-Einsteinweg", parameter="pm25",
date_from="2015-09-01",
date_to="2015-12-31")
#> Warning: package 'bindrcpp' was built under R version 3.3.2
# filter negative values
# and rename columns for compatibilities with openair
# I do not drop the old columns though
measurementsNL <- dplyr::mutate(measurementsNL, date=dateLocal,
pm25=value) %>%
filter(value>=0)
# for now openair functions do not work with tbl_df objects
# on MY computer
measurementsNL <- as.data.frame(measurementsNL)
# useful timeplot
timePlot(mydata=measurementsNL, pollutant = "pm25")
# cool calendar plot
calendarPlot(mydata=measurementsNL, pollutant = "pm25", year =2015)