@dataknut
)Please note that authorship is alphabetical. Contributions are listed below - see github for details and who to blame for what :-).
Ben Anderson (b.anderson@soton.ac.uk @dataknut
)
If you wish to refer to any of the material from this report please cite as:
Report circulation:
Report purpose:
official
New Zealand Air Quality dataThis work has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 700386 (SPATIALEC).
This work is (c) 2019 the University of Southampton.
LAWA seems to hold sub-daily data as it is used to create almost real-time plots & reports - see https://www.lawa.org.nz/explore-data/otago-region/air-quality/alexandra/alexandra-at-5-ventry-street/
It is unclear how we can access this data so for now we have used the MfE data.
PM 10 data: has more sensors and wider coverage.
Data source: https://data.mfe.govt.nz/data/category/air/
Data file: mfe-pm10-concentrations-200617-CSV/pm10-concentrations-200617.csv
df <- paste0(dPath, pm10File)
pm10dt <- data.table::fread(df)
pm10dt[, `:=`(ba_date, lubridate::as_date(date))]
# the data is daily but there may be gaps?
pm10dt[, `:=`(council.site, paste0(council, ".", site))]
Overall there are:
# looks like daily data with gaps
p <- makeTilePlot(pm10dt[council.site %like% "ORC"], yvar = "pm10", byvar = "council.site")
p + labs(y = "pm10") + guides(fill = guide_legend(title = "pm10"))
st <- pm10dt[, .(mean_PM10 = mean(pm10), min_PM10 = min(pm10), max_PM10 = max(pm10),
nObs = .N, startDate = min(ba_date), endDate = max(ba_date)), keyby = .(council)]
kableExtra::kable(st, digits = 2, caption = "Summary statstics for PM10 by Council") %>%
kable_styling()
council | mean_PM10 | min_PM10 | max_PM10 | nObs | startDate | endDate |
---|---|---|---|---|---|---|
AC | 14.63 | 1.28 | 275.95 | 41471 | 2006-01-02 | 2016-12-31 |
BOPRC | 17.16 | -0.82 | 433.75 | 15931 | 2006-01-02 | 2016-12-31 |
ECAN | 20.70 | -0.55 | 191.53 | 36549 | 2006-01-02 | 2017-09-03 |
GDC | 13.11 | -10.00 | 75.30 | 1671 | 2006-04-18 | 2017-11-20 |
GWRC | 12.04 | 0.07 | 93.75 | 14944 | 2006-01-02 | 2016-12-31 |
HBRC | 16.04 | -0.60 | 86.22 | 6346 | 2006-01-02 | 2017-11-01 |
HRC | 14.35 | 2.92 | 105.48 | 6703 | 2006-07-05 | 2017-12-31 |
MDC | 16.17 | -8.00 | 82.70 | 3833 | 2006-06-24 | 2017-11-25 |
NCC | 18.39 | -1.00 | 116.00 | 10359 | 2006-01-02 | 2017-12-31 |
NRC | 13.84 | -0.20 | 94.91 | 5692 | 2006-05-04 | 2016-12-31 |
ORC | 23.39 | 0.00 | 203.21 | 21712 | 2006-01-02 | 2017-08-31 |
SRC | 19.88 | 0.54 | 141.68 | 7920 | 2006-05-07 | 2016-12-31 |
TDC | 19.99 | 3.00 | 133.00 | 3920 | 2006-01-02 | 2016-12-31 |
WCRC | 20.08 | 0.00 | 129.06 | 3721 | 2006-05-03 | 2017-11-19 |
WRC | 14.02 | -7.43 | 135.47 | 29192 | 2006-01-02 | 2016-12-31 |
Table 3.1 suggests there are negative values for some days. Why?
Figure 3.2 shows daily values for all sites and indicates those that cross the:
# looks like daily data with gaps
p <- makeLinePlot(pm10dt, yvar = "pm10", byvar = "council.site")
p <- p + labs(y = "pm10", caption = "NZ/WHO threshold shown in red") + geom_hline(yintercept = dailyPm10Threshold_WHO,
colour = "red") + geom_hline(yintercept = dailyPm10Threshold_NZ, colour = "red") +
guides(colour = guide_legend(title = "pm10")) + theme(legend.position = "bottom") +
facet_grid(council ~ .)
p
plotly::ggplotly(p)