Read specific version of a time series given time series key (unique identifier) and validity. By default, this function returns the most recent version of a time series.

db_ts_read(
  con,
  ts_keys,
  valid_on = NULL,
  regex = FALSE,
  respect_release_date = FALSE,
  schema = "timeseries",
  chunksize = 10000
)

Arguments

con

RPostgres connection object.

ts_keys

character vector of time series identifiers.

valid_on

character representation of a date in the form of 'YYYY-MM-DD'. valid_on selects the version of a time series that is valid at the specified time.

regex

boolean indicating if ts_keys should be interpreted as a regular expression pattern. Defaults to FALSE.

respect_release_date

boolean indicating if it should the release embargo of a time series be respected. Defaults to FALSE. This option makes sense when the function is used in an API. In that sense, users do not have direct access to this function and therefore cannot simply switch parameters.

schema

character name of the database schema. Defaults to 'timeseries'

chunksize

set a limit of the number of time series requested in the function.

Value

list of time series. List elements vary depending on nature of time series, i.e., regular vs. irregular time series.

Examples


if (FALSE) {
db_ts_store(con = connection, zrh_airport, schema = "schema")
db_ts_read(con = connection, ts_keys = "ch.zrh_airport.departure.total", schema = "schema")
}