## 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
thedata <- importAURN(site = c("nott", "kc1"), year = 2008,
pollutant = "o3")
thedata <- reshape(thedata, idvar = "date", timevar = "code", direction
= "wide")
## thedata now has columns o3.MY1 and o3.KC1
## can also get rid of columns, in this case site:
thedata <- reshape(thedata, idvar = "date", timevar = "code", direction
= "wide", drop = "site")
## now can export as a csv file:
write.csv(thedata, file = "~/temp/thedata.csv")
Run the code above in your browser using DataLab