read_measures: get pollutants measurements

Description Usage Arguments Value available pollutants Note See Also Examples

View source: R/read_measures.R

Description

get measurements of pollutants as a data.frame. All measures are using unit microgram per cubic meter.

Usage

1
2
3
read_measures(pollutant = "pm10", granularity = "day",
  dt_start = format(Sys.Date() - 7), dt_end = format(Sys.Date() - 1),
  station_id = NULL, record_max = 2000)

Arguments

pollutant

one of the following values: 'o3', 'pm10', 'pm25', 'nox', 'no2', 'so2'.

granularity

one of the following values: 'hour', 'day'.

dt_start, dt_end

limit dates (character formated as ' is mandatory.

station_id

station_id. If NULL, measures from all stations are retrieved. The stations are described in dataset stations.

record_max

maximum number of records to read

Value

a data.frame with the following columns:

available pollutants

The following pollutants are available :

Note

The API of airparif is limiting the number of records to 2000; it is necessary to loop over dates or stations when more rows are needed.

See Also

stations, is_magellan_available()

Other functions about Paris air quality: read_alert, read_atmo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if( is_magellan_available() ){

read_measures()
read_measures(pollutant = "pm10", station_id = "4002")
read_measures(pollutant = "pm25", station_id = "4002")
read_measures(pollutant = "o3", station_id = "4049")
read_measures(pollutant = "nox", station_id = "4002")
read_measures(pollutant = "no2", station_id = "4002")
read_measures(pollutant = "nox",
  dt_start = as.Date("2018-09-01"),
  station_id = "4323")
read_measures(pollutant = "pm10", station_id = "4181",
  dt_start = as.Date("2019-06-01"), granularity = "hour")

}

ardata-fr/airparis documentation built on Nov. 3, 2019, 1:56 p.m.