db_ts_read_history: Read the Entire History of a Time Series

View source: R/read_time_series.R

db_ts_read_historyR Documentation

Read the Entire History of a Time Series

Description

This function returns a list whose keys correspond to the date on which the contained version of the time series took effect.

Usage

db_ts_read_history(
  con,
  ts_key,
  respect_release_date = FALSE,
  schema = "timeseries"
)

Arguments

con

RPostgres connection object.

ts_key

character The identifier of the time series to read.

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'

See Also

Other time series functions: db_collection_read_ts(), db_dataset_read_ts(), db_ts_delete_latest_version(), db_ts_delete(), db_ts_get_last_update(), db_ts_read(), db_ts_store(), db_ts_trim_history()

Examples


## Not run: 

# Storing different versions of the data, use parameter valid_from
# different versions are stored with the same key
ch.kof.barometer <- kof_ts["baro_2019m11"]
names(ch.kof.barometer) <- c("ch.kof.barometer")
db_ts_store(con = connection,
                  ch.kof.barometer,
                  valid_from = "2019-12-01",
                  schema = "schema")

ch.kof.barometer <- kof_ts["baro_2019m12"]
names(ch.kof.barometer) <- c("ch.kof.barometer")
db_ts_store(con = connection,
                  ch.kof.barometer,
                  valid_from = "2020-01-01",
                  schema = "schema")

# Reading all versions
db_ts_read_history(con = connection,
                         ts_key = "ch.kof.barometer",
                         schema = "schema")

## End(Not run)

timeseriesdb documentation built on March 24, 2022, 1:06 a.m.