Title: | A Simple Round Robin Database |
---|---|
Description: | A simple round robin database for storing fixed length histories of timeseries data. Inspired by whisperDB, but not feature or structure compatable. |
Authors: | Paul Smith [aut, cre] |
Maintainer: | Paul Smith <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.1 |
Built: | 2024-11-15 04:51:31 UTC |
Source: | https://github.com/waternumbers/rrdb |
Create a round robin database for a series of numeric data collected at regular time intervals
create_db(fn, tz_step, n, m, tz_origin = 0, size = 8)
create_db(fn, tz_step, n, m, tz_origin = 0, size = 8)
fn |
file name |
tz_step |
step of time series data in seconds |
n |
number of steps to store |
m |
number of data points at each time step |
tz_origin |
origin of time steps in seconds |
size |
size in bits of the written numeric data |
The value tz_origin can be though off as the offset from 1970-01-01 00:00:00 (0 epoch time) of the closest observation time e.g is observations were record hourly at 5 minutes past the hour tz_step=3600 and tz_origin = 300
invisible(TRUE) but called for the bi-product of creating the file
Reads data for a specfied time window from the database
read_db(fn, strt, fnsh, tz = "UTC")
read_db(fn, strt, fnsh, tz = "UTC")
fn |
file name |
strt |
POSIXct (or interger) object for the start of the period |
fnsh |
POSIXct (or interger) object for the end of the period |
tz |
time zone used for the output |
an xts object containing any data in the time period
Adds data to the database overwriting existing data in a round robin fashion
update_db(fn, D, check = TRUE)
update_db(fn, D, check = TRUE)
fn |
file name |
D |
the xts data object to write to the file |
check |
should the age of the overwritten data be checked |
Invisible(TRUE) but Called for the bi-product of updating the data