Package 'rrdb'

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-12-15 07:17:29 UTC
Source: https://github.com/waternumbers/rrdb

Help Index


Create a database

Description

Create a round robin database for a series of numeric data collected at regular time intervals

Usage

create_db(fn, tz_step, n, m, tz_origin = 0, size = 8)

Arguments

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

Details

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

Value

invisible(TRUE) but called for the bi-product of creating the file


Read data from the database

Description

Reads data for a specfied time window from the database

Usage

read_db(fn, strt, fnsh, tz = "UTC")

Arguments

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

Value

an xts object containing any data in the time period


Update the data in a database

Description

Adds data to the database overwriting existing data in a round robin fashion

Usage

update_db(fn, D, check = TRUE)

Arguments

fn

file name

D

the xts data object to write to the file

check

should the age of the overwritten data be checked

Value

Invisible(TRUE) but Called for the bi-product of updating the data