osem_measurements_archive: Fetch day-wise measurements for a single box from the...

Description Usage Arguments Details Value Methods (by class) See Also Examples

Description

This function is significantly faster than osem_measurements for large time-frames, as daily CSV dumps for each sensor from archive.opensensemap.org are used. Note that the latest data available is from the previous day.

Usage

1
2
3
4
5
osem_measurements_archive(x, ...)

## S3 method for class 'sensebox'
osem_measurements_archive(x, fromDate,
  toDate = fromDate, sensorFilter = ~T, ..., progress = T)

Arguments

x

A 'sensebox data.frame' of a single box, as retrieved via osem_box, to download measurements for.

...

see parameters below

fromDate

Start date for measurement download, must be convertable via 'as.Date'.

toDate

End date for measurement download (inclusive).

sensorFilter

A NSE formula matching to x$sensors, selecting a subset of sensors.

progress

Whether to print download progress information, defaults to TRUE.

Details

By default, data for all sensors of a box is fetched, but you can select a subset with a dplyr-style NSE filter expression.

The function will warn when no data is available in the selected period, but continue the remaining download.

Value

A tbl_df containing observations of all selected sensors for each time stamp.

Methods (by class)

See Also

openSenseMap archive

osem_measurements

osem_box

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  # fetch measurements for a single day
  box = osem_box('593bcd656ccf3b0011791f5a')
  m = osem_measurements_archive(box, as.POSIXlt('2018-09-13'))

  # fetch measurements for a date range and selected sensors
  sensors = ~ phenomenon %in% c('Temperatur', 'Beleuchtungsst<c3><a4>rke')
  m = osem_measurements_archive(
    box,
    as.POSIXlt('2018-09-01'), as.POSIXlt('2018-09-30'),
    sensorFilter = sensors
  )

opensensmapr documentation built on May 2, 2019, 2:58 p.m.