sinaica_station_data: Get air quality data from a single measuring station

Description Usage Arguments Value See Also Examples

View source: R/sinaica_station_data.R

Description

Download data from a single station by specifying a parameter and a date range

Usage

1
2
sinaica_station_data(station_id, parameter, start_date, end_date,
  type = "Crude", remove_extremes = FALSE)

Arguments

station_id

the numeric code corresponding to each station. See stations_sinaica for a list of stations and their ids.

parameter

type of parameter to download

  • "BEN" - Benceno

  • "CH4" - Metano

  • "CN" - Carbono negro

  • "CO" - Mon<c3><b3>xido de carbono

  • "CO2" - Di<c3><b3>xido de carbono

  • "DV" - Direcci<c3><b3>n del viento

  • "H2S" - Acido Sulfh<c3><ad>drico

  • "HCNM" - Hidrocarburos no met<c3><a1>nicos

  • "HCT" - Hidrocarburos Totales

  • "HR" - Humedad relativa

  • "HRI" - Humedad relativa interior

  • "IUV" - <c3><8d>ndice de radiaci<c3><b3>n ultravioleta

  • "NO" - <c3><93>xido n<c3><ad>trico

  • "NO2" - Di<c3><b3>xido de nitr<c3><b3>geno

  • "NOx" - <c3><93>xidos de nitr<c3><b3>geno

  • "O3" - Ozono

  • "PB" - Presi<c3><b3>n Barom<c3><a9>trica

  • "PM10" - Part<c3><ad>culas menores a 10 micras

  • "PM2.5" - Part<c3><ad>culas menores a 2.5 micras

  • "PP" - Precipitaci<c3><b3>n pluvial

  • "PST" - Part<c3><ad>culas Suspendidas totales

  • "RS" - Radiaci<c3><b3>n solar

  • "SO2" - Di<c3><b3>xido de azufre

  • "TMP" - Temperatura

  • "TMPI" - Temperatura interior

  • "UVA" - Radiaci<c3><b3>n ultravioleta A

  • "VV" - Radiaci<c3><b3>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

  • "Validated" - data which has undergone a validation process during which it was cleaned, verified, and 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 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.

See Also

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

Examples

1
2
3
stations_sinaica[which(stations_sinaica$station_name == "Xalostoc"), 1:5]
df <- sinaica_station_data(271, "O3", "2015-09-11", "2015-09-11", "Crude")
head(df)

rsinaica documentation built on May 2, 2019, 8:03 a.m.