Skip to contents

Import data from the Scottish Air Quality Network

Usage

importSAQN(
  site = "gla4",
  year = 2009,
  data_type = "hourly",
  pollutant = "all",
  meta = FALSE,
  meteo = TRUE,
  ratified = FALSE,
  to_narrow = FALSE,
  progress = TRUE
)

Arguments

site

Site code of the site to import e.g. “gla4” is Glasgow Kerbside. Several sites can be imported with site = c("gla4", "gla5") --- to import Glasgow Kerbside and Anderston, for example.

year

Year or years to import. To import a sequence of years from 1990 to 2000 use year = 1990:2000. To import several specific years use year = c(1990, 1995, 2000) for example.

data_type

The data type averaging period. These include:

  • "hourly" Default is to return hourly data.

  • "daily" Daily average data.

  • "monthly" Monthly average data with data capture information for the whole network.

  • "annual" Annual average data with data capture information for the whole network.

  • "15_min" To import 15-minute average SO2 concentrations.

  • "8_hour" To import 8-hour rolling mean concentrations for O3 and CO.

  • "24_hour" To import 24-hour rolling mean concentrations for particulates.

  • "daily_max_8" To import maximum daily rolling 8-hour maximum for O3 and CO.

  • "daqi" To import Daily Air Quality Index (DAQI). See here for more details of how the index is defined.

pollutant

Pollutants to import. If omitted will import all pollutants from a site. To import only NOx and NO2 for example use pollutant = c("nox", "no2").

meta

Should meta data be returned? If TRUE the site type, latitude and longitude are returned.

meteo

Should modelled meteorological data be returned if available. The default is TRUE and will return wind speed (ws), wind direction (wd) and ambient temperature (air_temp). The variables are calculated from using the WRF model run by Ricardo Energy & Environment and are available for most but not all networks. Setting meteo = FALSE is useful if you have other meteorological data to use in preference e.g. from worldmet.

ratified

If TRUE columns are returned indicating when each species was ratified i.e. quality-checked. Available for hourly data only.

to_narrow

By default the returned data has a column for each pollutant/variable. When to_narrow = TRUE the data are stacked into a narrow format with a column identifying the pollutant name.

progress

Show a progress bar when many sites/years are being imported? Defaults to TRUE.

See also