This function converts pollution running averages in the original units (ppb, µg/m³, etc) to IMECA
convert_to_imeca(value, pollutant, showWarnings = TRUE)
value  a numeric vector of values to convert to IMECAs. Note that the concentration of pollutants can be measured in different ways, for NO2, and O3 a 1 hour average is used, for CO, an 8 hour average, and for SO2, PM10 and PM25 a 24 hour average is used. 

pollutant  type of pollutant. A vector of one or more of the following options:

showWarnings  deprecated; you can use the function

A vector containing the converted value in IMECAs
Air quality in Mexico City is reported in IMECAs (Índice Metropolitano de la Calidad del Aire), a dimensionless scale where all pollutants can be compared.
Note that each pollutant has different averaging periods (see the arguments section). Because of rounding error results may be off by a couple of points.
For the formulas on how to convert visit: AVISO POR EL QUE SE DA A CONOCER EL PROYECTO DE NORMA AMBIENTAL PARA EL DISTRITO FEDERAL
Other convert functions: convert_to_index
## IMECA is a dimensionless scale that allows for the comparison of ## different pollutants convert_to_imeca(157, "O3")#> [1] 153#> [1] 155 132 110## Since this is PM10 the 80 is supposed to be the 24 hour average convert_to_imeca(80, "PM10")#> [1] 102#> Warning: The vectors are of unequal length. Recycling elements of the shorter vector to match the longer vector.#> [1] 153 196convert_to_imeca(67, "O3")#> [1] 48convert_to_imeca(77, "O3")#> [1] 63convert_to_imeca(205, "O3")#> [1] 201convert_to_imeca(72, "O3")#> [1] 53convert_to_imeca(98, "O3")#> [1] 103