Description Usage Arguments Value Examples
Parses raw air quality data published by http://datos.madrid.es/ and returns a clean data frame.
1 | madrid.air.parse(input, output = NA, station = NA, magnitude = NA)
|
input |
Input file containing the raw air quality data. |
output |
Optional CSV file where the air quality data data frame will be saved. |
station |
Filter data by station code (see
|
magnitude |
Filter data by magnitude name (see
|
A data frame containing air quality data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | # Download and parse daily data.
download.file('http://datos.madrid.es/egob/catalogo/201410-14-calidad-aire-diario.txt',
'201410-14-calidad-aire-diario.txt')
madrid.air.parse('201410-14-calidad-aire-diario.txt')
# Save air quality data to disk.
madrid.air.parse('201410-14-calidad-aire-diario.txt',
output='201410-14-calidad-aire-diario.csv')
# Download and parse hourly data.
download.file('http://datos.madrid.es/egob/catalogo/201200-29-calidad-aire-horario.zip',
'201200-29-calidad-aire-horario.zip')
unzip('201200-29-calidad-aire-horario.zip')
madrid.air.parse('Ene_mo01.txt')
# Check station information.
data(madrid.air.stations)
madrid.air.stations
# Filter by station.
madrid.air.parse('Ene_mo01.txt', station=28079001)
# Check magnitude information.
data(madrid.air.magnitudes)
madrid.air.magnitudes
# Filter by magnitude.
madrid.air.parse('Ene_mo01.txt', magnitude='CO')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.