get_timeseries_tsid: Download timeseries data from waterinfo.be

View source: R/get_timeseries.R

get_timeseries_tsidR Documentation

Download timeseries data from waterinfo.be

Description

Using the ts_id codes and by providing a given date period, download the corresponding time series from the waterinfo.be website

Usage

get_timeseries_tsid(
  ts_id,
  period = NULL,
  from = NULL,
  to = NULL,
  datasource = 1,
  token = NULL
)

Arguments

ts_id

waterinfo.be database ts_id, defining a timeserie variable and frequency it is defined.

period

input string according to format required by waterinfo: De period string is provided as P#Y#M#DT#H#M#S, with P defines 'Period', each # is an integer value and the codes define the number of... Y - years M - months D - days T required if information about sub-day resolution is present H - hours D - days M - minutes S - seconds Instead of D (days), the usage of W - weeks is possible as well Examples of valid period strings: P3D, P1Y, P1DT12H, PT6H, P1Y6M3DT4H20M30S.

from

date of datestring as start of the time series

to

date of datestring as end of the time series

datasource

int [0-4] defines the 'meetnet' of which the measurement station is part of. VMM based stations are net '1', MOW-HIC is net '2'

token

token to use with the call (optional, can be retrieved via get_token)

Format

A data.frame with 3 variables:

Timestamp

Datetime of the measurement.

Value

Measured value.

Quality Code

Quality code of the measurement, dependent on the data source used:

  • VMM Quality Code Interpretation (datasource 1)

    • 10/110 - Excellent

    • 30/100/130 - Good

    • 50/150 - Moderate

    • 70/170 - Poor

    • 80/180 - Estimated

    • 90/190 - Suspect

    • 220 - Default

    • -1 - Missing

  • HIC Quality Code Interpretation (datasource 2)

    • 40 - Good

    • 80 - Estimated

    • 120 - Suspect

    • 200 - Unchecked

    • 60 - Complete

    • 160 - Incomplete

    • -1 - Missing

  • Aggregated timeseries

    • 40 - Good

    • 100 - Estimated

    • 120 - Suspect

    • 200 - Unchecked

    • -1 - Missing

The URL of the specific request is provided as a comment attribute to the returned data.frame. Use comment(df) to get the request URL.

Value

data.frame with the timestamps, values and quality code

Examples

get_timeseries_tsid("35055042", from = "2017-01-01", to = "2017-01-02")
get_timeseries_tsid("5156042", period = "P3D")
get_timeseries_tsid("55419010", from = "2017-06-01", to = "2017-06-03",
                    datasource = 4)

ropensci/wateRinfo documentation built on July 12, 2022, 12:11 p.m.