R/delete_time_series.R
db_ts_delete_latest_version.Rd
Vintages of time series should not be deleted as they are versions and represent a former status of a time series that may not be stored elsewhere, even not with their original provider. To benchmark forecasts it is essential to keep the versions to evaluate real time performance of forecasts. However, when operating at current edge of a time series, i.e., its last update, mistakes may happen. Hence timeseriesdb allows to update / delete the last iteration. Do not loop recursively through iterations to delete an entire time series. There are admin level functions for that.
db_ts_delete_latest_version(con, ts_keys, schema = "timeseries")
RPostgres connection object.
character vector of time series identifiers.
character name of the database schema. Defaults to 'timeseries'
Other time series functions:
db_collection_read_ts()
,
db_dataset_read_ts()
,
db_ts_delete()
,
db_ts_get_last_update()
,
db_ts_read_history()
,
db_ts_read()
,
db_ts_store()
,
db_ts_trim_history()
if (FALSE) {
# Store different versions of the time series data
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"
)
db_ts_delete_latest_version(
con = connection,
ts_keys = "ch.kof.barometer",
schema = "schema"
)
}