readings: Query WAQI Stations Readings

Description Usage Arguments Value See Also Examples

View source: R/readings.R

Description

Access the WAQI API to query readings for a given set of monitoring stations.

Usage

1
readings(x, token, uid = "uid", dsn = NULL, ...)

Arguments

x, token, uid

See metainfo.

dsn

Optional target folder for automated .fst file output, see also write_fst.

...

Additional arguments passed to makePSOCKcluster.

Value

Retrieved readings as data.frame. Note that stations that could not be found or were temporarily out of service are not included.

See Also

inventory

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
## spatial extent: bavaria
deu = raster::getData(country = "DEU", level = 1, path = raster::tmpDir())
bay = subset(deu, NAME_1 == "Bayern")

## api token
tkn = keyring::key_get("waqi_api")

## query monitoring stations within spatial extent
stn = inventory(bay, token = tkn)

## query station readings
vls = readings(stn, token = tkn, names = parallel::detectCores() - 1)
vls

## End(Not run)

fdetsch/claiR documentation built on July 27, 2021, 6:26 p.m.