R/sinaica_station_data.R
sinaica_station_data.Rd
Download data from a single station by specifying a parameter and a date range
sinaica_station_data(station_id, parameter, start_date, end_date, type = "Crude", remove_extremes = FALSE)
station_id | the numeric code corresponding to each station. See
|
---|---|
parameter | type of parameter to download
|
start_date | start of range in YYYY-MM-DD format |
end_date | end of range from which to download data in YYYY-MM-DD format |
type | The type of data to download. One of the following:
|
remove_extremes | whether to remove extreme values. For O3 all values above .2 are set to NA, for PM10 those above 600, for PM2.5 above 175, for NO2 above .21, for SO2 above .2, and for CO above 15. This is done so that the values match exactly those of the SINAICA website, but it is recommended that you use a more complicated statistical procedure to remove outliers. |
data.frame with air quality data. Care should be taken when working with hourly data since
each station has their own timezone (available in the stations_sinaica
data.frame)
and some stations reported the timezome in which they are located erroneously.
Crude data comes from https://sinaica.inecc.gob.mx/data.php, validated data from https://sinaica.inecc.gob.mx/data.php?tipo=V, and manual data from https://sinaica.inecc.gob.mx/data.php?tipo=M
#> station_id station_name station_code network_id network_name #> 329 271 Xalostoc XAL 119 Valle de México#> id date hour value valid unit station_id station_name #> 1 271O315091100 2015-09-11 0 0.013 1 ppm 271 Xalostoc #> 2 271O315091101 2015-09-11 1 0.015 1 ppm 271 Xalostoc #> 3 271O315091102 2015-09-11 2 0.006 1 ppm 271 Xalostoc #> 4 271O315091103 2015-09-11 3 0.014 1 ppm 271 Xalostoc #> 5 271O315091104 2015-09-11 4 0.010 1 ppm 271 Xalostoc #> 6 271O315091105 2015-09-11 5 0.003 1 ppm 271 Xalostoc