add_to_db: Add data to RRD database into existing table

View source: R/add_to_db.R

add_to_dbR Documentation

Add data to RRD database into existing table

Description

Add data to RRD database into existing table

Usage

add_to_db(
  fns,
  db = getOption("RRDdb", "LEEF.RRD.sqlite"),
  tables,
  remove_timestamps = NULL,
  check_timestamps = TRUE,
  backup_removed = TRUE,
  DBIDriver = RSQLite::SQLite()
)

Arguments

fns

vector of rds or csv files names containing data to be added. The data has to contain a colum named timestamp.

db

fully qualified path to the sqlite database. Default, read from option RRDdb. If not set, defaults to option RRDdb; if this is not set, defaults to LEEF.RRD.sqlite

tables

vector of the table names the data of the fns of the same index should be added to. The table has to exist and contain a field named timestamp

remove_timestamps

vector of timestamps to be removed.

backup_removed

if 'TRUE' data which will be replaced will be backed up.

DBIDriver

the DBI driver to use. Default is RSQLite::SQLite()

check_timestamps.

If TRUE, the data will ony be added when timestamp does not exist in db yet. If FALSE, it will always be added. Usually this should NOT be done.

Value

vector of length of fns with TRUE if the data has been added, FALSE otherwise


LEEF-UZH/LEEF.analysis documentation built on Feb. 8, 2025, 11:18 a.m.