Learn R Programming

timeseriesdb (version 1.0.0-1.1.2)

db_collection_add_ts: Bundles Keys into an Existing Collection or Adds a New Collection

Description

Collections are user specific compilations of time series keys. Similar to a playlist in a music app, collections help to come back to a previously stored selection of time series. This functions adds more time series to existing bundles (collections).

Usage

db_collection_add_ts(
  con,
  collection_name,
  ts_keys,
  description = NULL,
  user = Sys.info()["user"],
  schema = "timeseries"
)

Arguments

con

RPostgres connection object.

collection_name

character name of a collection to read. Collection are bookmark lists that contain time series keys.

ts_keys

character vector of time series identifiers.

description

character description of the collection.

user

character name of the database user. Defaults to the user of the R session. this is often the user for the database, too so you do not have to specify your username explicitly if that is the case.

schema

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

See Also

Other collections functions: db_collection_delete(), db_collection_get_keys(), db_collection_get_last_update(), db_collection_list(), db_collection_remove_ts()

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
db_ts_store(con = connection, zrh_airport, schema = "schema")
db_ts_store(con = connection, kof_ts, schema = "schema")

db_collection_add_ts(
  con = connection,
  collection_name = "barometer and departures zurich",
  ts_keys = c(
    "ch.zrh_airport.departure.total",
    "ch.zrh_airport.departure.total",
    "ch.kof.barometer"
  ),
  schema = "schema"
)
# }

Run the code above in your browser using DataLab