Download data from all stations for a single parameter by specifying a date range

sinaica_param_data(parameter, start_date, end_date, type = "Crude",
  remove_extremes = FALSE)

Arguments

parameter

type of parameter to download

  • "BEN" - Benceno

  • "CH4" - Metano

  • "CN" - Carbono negro

  • "CO" - Monóxido de carbono

  • "CO2" - Dióxido de carbono

  • "DV" - Dirección del viento

  • "H2S" - Acido Sulfhídrico

  • "HCNM" - Hidrocarburos no metánicos

  • "HCT" - Hidrocarburos Totales

  • "HR" - Humedad relativa

  • "HRI" - Humedad relativa interior

  • "IUV" - Índice de radiación ultravioleta

  • "NO" - Óxido nítrico

  • "NO2" - Dióxido de nitrógeno

  • "NOx" - Óxidos de nitrógeno

  • "O3" - Ozono

  • "PB" - Presión Barométrica

  • "PM10" - Partículas menores a 10 micras

  • "PM2.5" - Partículas menores a 2.5 micras

  • "PP" - Precipitación pluvial

  • "PST" - Partículas Suspendidas totales

  • "RS" - Radiación solar

  • "SO2" - Dióxido de azufre

  • "TMP" - Temperatura

  • "TMPI" - Temperatura interior

  • "UVA" - Radiación ultravioleta A

  • "VV" - Radiación ultravioleta B

  • "XIL" - Xileno

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:

  • "Crude" - Crude data that has not been validated

  • "Manual" - Manually collected data that is sent to an external lab for analysis (may no be collected daily). Mostly used for suspend particles collected by pushing air through a filter which is later sent to a lab to be weighted

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.

Value

data.frame with a column named value containing the air quality parameter values. If the data was validated the column named date_validated will contain the validation date. 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.

Examples

# NOT RUN {
## May take several seconds
df <- sinaica_param_data("O3", "2015-10-14", "2015-10-14")
head(df)
# }