openair (version 1.6.7)

importAURN: Import data from the UK Automatic Urban and Rural Network (AURN)

Description

Function for importing hourly mean UK Automatic Urban and Rural Network (AURN) air quality archive data files for use with the openair package. Files are imported from a remote server operated by AEA that provides air quality data files as R data objects.

Usage

importAURN(site = "my1", year = 2009, pollutant = "all", hc = FALSE)

Arguments

site
Site code of the AURN site to import e.g. "my1" is Marylebone Road. Several sites can be imported with site = c("my1", "nott") --- to import Marylebone Road and Nottingham 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 specfic years use year = c(1990, 1995, 2000) for example.
pollutant
Pollutants to import. If omitted will import all pollutants ffrom a site. To import only NOx and NO2 for example use pollutant = c("nox", "no2").
hc
A few sites have hydrocarbon measurements available and setting hc = TRUE will ensure hydrocarbon data are imported. The default is however not to as most users will not be interested in using hydrocarbon data and the resulting data frames

Value

  • Returns a data frame of hourly mean values with date in POSIXct class and time zone GMT.

Details

The importAURN function has been written to make it easy to import data from the UK AURN. AEA have provided .RData files (R workspaces) of all individual sites and years for the AURN. These files are updated on a daily basis. This approach requires a link to the Internet to work. There are several advantages over the web portal approach where .csv files are downloaded. First, it is quick to select a range of sites, pollutants and periods (see examples below). Second, storing the data as .RData objects is very efficient as they are about four times smaller than .csv files --- which means the data downloads quickly and saves bandwidth. Third, the function completely avoids any need for data manipulation or setting time formats, time zones etc. Finally, it is easy to import many years of data beyond the current limit of about 64,000 lines. The final point makes it possible to download several long time series in one go. The function also has the advantage that the proper site name is imported and used in openair functions. The site codes and pollutant names can be upper or lower case. The function will issue a warning when data less than six months old is downloaded, which may not be ratified. The data are imported by stacking sites on top of one another and will have field names site, code (the site code) and pollutant. Sometimes it is useful to have columns of site data. This can be done using the reshape function --- see examples below. All units are expressed in mass terms for gaseous species (ug/m3 for NO, NO2, NOx (as NO2), SO2 and hydrocarbons; and mg/m3 for CO). PM10 concentrations are provided in gravimetric units of ug/m3 or scaled to be comparable with these units. Over the years a variety of instruments have been used to measure particulate matter and the technical issues of measuring PM10 are complex. In recent years the measurements rely on FDMS (Filter Dynamics Measurement System), which is able to measure the volatile component of PM. In cases where the FDMS system is in use there will be a separate volatile component recorded as 'v10' and non-volatile component 'nv10', which is already included in the absolute PM10 measurement. Prior to the use of FDMS the measurements used TEOM (Tapered Element Oscillating. Microbalance) and these concentrations have been multiplied by 1.3 to provide an estimate of the total mass including the volatile fraction. The few BAM (Beta-Attenuation Monitor) instruments that have been incorporated into the network throughout its history have been scaled by 1.3 if they have a heated inlet (to account for loss of volatile particles) and 0.83 if they do not have a heated inlet. The few TEOM instruments in the network after 2008 have been scaled using VCM (Volatile Correction Model) values to account for the loss of volatile particles. The object of all these scaling processes is to provide a reasonable degree of comparison between data sets and with the reference method and to produce a consistent data record over the operational period of the network, however there may be some discontinuity in the time series associated with instrument changes. No corrections have been made to teh PM2.5 data. The volatile component of FDMS PM2.5 (where available) is shown in the 'v2.5' column. While the function is being developed, the following site codes should help with selection.
  • A3 | London A3 Roadside | Urban traffic
  • ABD | Aberdeen | Urban Background
  • ABD7 | Aberdeen Union Street Roadside | Urban traffic
  • ACTH | Auchencorth Moss | Rural Background
  • AH | Aston Hill | Rural Background
  • ARM6 | Armagh Roadside | Urban traffic
  • BALM | Ballymena | Urban Background
  • BAR2 | Barnsley 12 | Urban Background
  • BAR3 | Barnsley Gawber | Urban Background
  • BARN | Barnsley | Urban Background
  • BATH | Bath Roadside | Urban traffic
  • BEL | Belfast East | Urban Background
  • BEL2 | Belfast Centre | Urban Background
  • BEL4 | Belfast Clara St | Suburban Background
  • BEX | London Bexley | Suburban Background
  • BHAM | Birmingham Kerbside | Urban traffic
  • BIL | Billingham | Urban Industrial
  • BIR | Bircotes | Urban Background
  • BIR1 | Birmingham Tyburn | Urban Background
  • BIR2 | Birmingham East | Urban Background
  • BIRM | Birmingham Centre | Urban Background
  • BIRT | Birmingham Tyburn Roadside | Urban traffic
  • BLAC | Blackpool | Urban Background
  • BLC2 | Blackpool Marton | Urban Background
  • BLCB | Blackburn Darwen Roadside | Urban traffic
  • BOLT | Bolton | Urban Background
  • BORN | Bournemouth | Urban Background
  • BOT | Bottesford | Rural Background
  • BRAD | Bradford Centre | Urban Background
  • BREN | London Brent | Urban Background
  • BRI | London Bridge Place | Urban Background
  • BRIS | Bristol Centre | Urban Background
  • BRIT | Brighton Roadside | Urban traffic
  • BRN | Brentford Roadside | Urban traffic
  • BRS2 | Bristol Old Market | Urban traffic
  • BRS8 | Bristol St Paul's | Urban Background
  • BRT3 | Brighton Preston Park | Urban Background
  • BURY | Bury Roadside | Urban traffic
  • BUSH | Bush Estate | Rural Background
  • BY1 | Bromley Roadside | Urban traffic
  • BY2 | London Bromley | Urban traffic
  • CA1 | Camden Kerbside | Urban traffic
  • CAM | Cambridge Roadside | Urban traffic
  • CAMB | Cambridge | Urban traffic
  • CAN | London Canvey | Urban Industrial
  • CANT | Canterbury | Urban Background
  • CAR | Cardiff Kerbside | Urban traffic
  • CARD | Cardiff Centre | Urban Background
  • CARL | Carlisle Roadside | Urban traffic
  • CHAT | Chatham Roadside | Urban traffic
  • CHIL | Chilworth | Suburban Background
  • CHP | Chepstow A48 | Urban traffic
  • CHS6 | Chesterfield | Urban Background
  • CHS7 | Chesterfield Roadside | Urban traffic
  • CLL | Central London | Urban Background
  • CLL2 | London Bloomsbury | Urban Background
  • COV2 | Coventry Centre | Urban Background
  • COV3 | Coventry Memorial Park | Urban Background
  • CRD | London Cromwell Road | Urban traffic
  • CRD2 | London Cromwell Road 2 | Urban traffic
  • CWMB | Cwmbran | Urban Background
  • DERY | Derry | Urban Background
  • DUMB | Dumbarton Roadside | Urban traffic
  • DUMF | Dumfries | Urban traffic
  • EAGL | Stockton-on-Tees Eaglescliffe | Urban traffic
  • EB | Eastbourne | Urban Background
  • ECCL | Salford Eccles | Urban Industrial
  • ED | Edinburgh Centre | Urban Background
  • ED3 | Edinburgh St Leonards | Urban Background
  • EK | East Kilbride | Suburban Background
  • ESK | Eskdalemuir | Rural Background
  • EX | Exeter Roadside | Urban traffic
  • FEA | Featherstone | Urban Background
  • FW | Fort William | Suburban Background
  • GDF | Great Dun Fell | Rural Background
  • GLA | Glasgow City Chambers | Urban Background
  • GLA3 | Glasgow Centre | Urban Background
  • GLA4 | Glasgow Kerbside | Urban traffic
  • GLAS | Glasgow Hope St | Urban traffic
  • GLAZ | Glazebury | Rural Background
  • GRA2 | Grangemouth Moray | Rural Background
  • GRAN | Grangemouth | Urban Industrial
  • HAR | Harwell | Rural Background
  • HARR | London Harrow | Suburban Background
  • HG1 | Haringey Roadside | Urban traffic
  • HG2 | London Haringey | Urban Background
  • HIL | London Hillingdon | Urban Background
  • HK4 | London Hackney | Urban Background
  • HM | High Muffles | Rural Background
  • HOPE | Stanford-le-Hope Roadside | Urban traffic
  • HORE | Horley | Suburban Background
  • HORS | London Westminster | Urban Background
  • HOVE | Hove Roadside | Urban traffic
  • HR3 | London Harrow Stanmore | Urban Background
  • HRL | London Harlington | Urban Industrial
  • HS1 | Hounslow Roadside | Urban traffic
  • HUL2 | Hull Freetown | Urban Background
  • HULL | Hull Centre | Urban Background
  • INV2 | Inverness | Urban traffic
  • ISL | London Islington | Urban Background
  • KC1 | London N. Kensington | Urban Background
  • LB | Ladybower | Rural Background
  • LDS | Leeds Potternewton | Urban Background
  • LEAM | Leamington Spa | Urban Background
  • LED6 | Leeds Headingley Kerbside | Urban traffic
  • LEED | Leeds Centre | Urban Background
  • LEIC | Leicester Centre | Urban Background
  • LEOM | Leominster | Suburban Background
  • LERW | Lerwick | Suburban Background
  • LH | Lullington Heath | Rural Background
  • LINC | Lincoln Roadside | Urban traffic
  • LIVR | Liverpool Centre | Urban Background
  • LN | Lough Navar | Rural Background
  • LON6 | London Eltham | Suburban Background
  • LON7 | London Eltham (HC) | Urban Background
  • LV6 | Liverpool Queen's Drive Roadside | Urban traffic
  • LVP | Liverpool Speke | Urban Background
  • LW1 | London Lewisham | Urban Background
  • MACK | Charlton Mackrell | Rural Background
  • MAN | Manchester Town Hall | Urban Background
  • MAN3 | Manchester Piccadilly | Urban Background
  • MAN4 | Manchester South | Suburban Background
  • MH | Mace Head | Rural Background
  • MID | Middlesbrough | Urban Background
  • MKTH | Market Harborough | Rural Background
  • MOLD | Mold | Suburban Background
  • MY1 | London Marylebone Road | Urban traffic
  • NCA3 | Newcastle Cradlewell Roadside | Urban traffic
  • NEWC | Newcastle Centre | Urban Background
  • NO10 | Norwich Forum Roadside | Urban traffic
  • NO12 | Norwich Lakenfields | Urban Background
  • NOR1 | Norwich Roadside | Urban traffic
  • NOR2 | Norwich Centre | Urban Background
  • NOTT | Nottingham Centre | Urban Background
  • NPT3 | Newport | Urban Background
  • NTON | Northampton | Urban Background
  • OLDB | Sandwell Oldbury | Urban Background
  • OSY | St Osyth | Rural Background
  • OX | Oxford Centre Roadside | Urban traffic
  • OX8 | Oxford St Ebbes | Urban Background
  • PEEB | Peebles | Urban Background
  • PEMB | Narberth | Rural Background
  • PLYM | Plymouth Centre | Urban Background
  • PMTH | Portsmouth | Urban Background
  • PRES | Preston | Urban Background
  • PT | Port Talbot | Urban Industrial
  • PT4 | Port Talbot Margam | Urban Industrial
  • REA1 | Reading New Town | Urban Background
  • READ | Reading | Urban Background
  • REDC | Redcar | Suburban Background
  • ROCH | Rochester Stoke | Rural Background
  • ROTH | Rotherham Centre | Urban Background
  • RUGE | Rugeley | Urban Background
  • SALT | Saltash Roadside | Urban traffic
  • SCN2 | Scunthorpe Town | Urban Industrial
  • SCUN | Scunthorpe | Urban Industrial
  • SDY | Sandy Roadside | Urban traffic
  • SEND | Southend-on-Sea | Urban Background
  • SHE | Sheffield Tinsley | Urban Background
  • SHE2 | Sheffield Centre | Urban Background
  • SIB | Sibton | Rural Background
  • SK1 | London Southwark | Urban Background
  • SK2 | Southwark Roadside | Urban traffic
  • SK5 | Southwark A2 Old Kent Road | Urban traffic
  • SOM | Somerton | Rural Background
  • SOUT | Southampton Centre | Urban Background
  • STE | Stevenage | Suburban Background
  • STEW | Stewartby | Urban Industrial
  • STK4 | Stockport Shaw Heath | Urban Background
  • STOC | Stockport | Urban Background
  • STOK | Stoke-on-Trent Centre | Urban Background
  • STOR | Storrington Roadside | Urban traffic
  • SUN2 | Sunderland Silksworth | Urban Background
  • SUND | Sunderland | Urban Background
  • SUT1 | Sutton Roadside | Urban traffic
  • SUT3 | London Sutton | Suburban Background
  • SV | Strath Vaich | Rural Background
  • SWA1 | Swansea Roadside | Urban traffic
  • SWAN | Swansea | Urban Background
  • TED | London Teddington | Urban Background
  • TH2 | Tower Hamlets Roadside | Urban traffic
  • THUR | Thurrock | Urban Background
  • TRAN | Wirral Tranmere | Urban Background
  • WA2 | London Wandsworth | Urban Background
  • WAL | Walsall Alumwell | Urban Background
  • WAL2 | Walsall Willenhall | Urban Background
  • WAR | Warrington | Urban Background
  • WBRO | Sandwell West Bromwich | Urban Background
  • WC | Wharleycroft | Rural Background
  • WEYB | Weybourne | Rural Background
  • WFEN | Wicken Fen | Rural Background
  • WIG3 | Wigan Leigh | Urban Background
  • WIG5 | Wigan Centre | Urban Background
  • WL | West London | Urban Background
  • WOLV | Wolverhampton Centre | Urban Background
  • WRAY | Wray | Rural Background
  • WREX | Wrexham | Urban traffic
  • YARM | Stockton-on-Tees Yarm | Urban traffic
  • YK10 | York Bootham | Urban Background
  • YK11 | York Fishergate | Urban traffic
  • YW | Yarner Wood | Rural Background

See Also

importKCL, importADMS, importSAQN

Examples

Run this code
## import all pollutants from Marylebone Rd from 1990:2009
mary <- importAURN(site = "my1", year = 2000:2009)

## import nox, no2, o3 from Marylebone Road and Nottingham Centre for 2000
thedata <- importAURN(site = c("my1", "nott"), year = 2000,
pollutant = c("nox", "no2", "o3"))

## import over 20 years of Mace Head O3 data!
o3 <- importAURN(site = "mh", year = 1987:2009)

## import hydrocarbon (and other) data from Marylebone Road
mary <- importAURN(site = "my1", year =1998, hc = TRUE)

## reshape the data so that each column represents a pollutant/site
require(reshape2)
thedata <- importAURN(site = c("nott", "kc1"), year = 2008,
pollutant = "o3")
thedata <- melt(thedata, measure.vars = "o3")
thedata <- dcast(thedata, ... ~ variable + site + code)
## thedata now has columns  o3_Nottingham Centre_NOTT o3_London N. Kensington_KC1

Run the code above in your browser using DataLab