aggregate.tsdb: aggregate.tsdb

Description Usage Arguments Examples

Description

Aggregate a 'data.tsdb' object

Usage

1
2
  aggregate.tsdb(x, by = list(), FUN = list(),
    seconds = 60, ..., simplify = TRUE)

Arguments

by

(optional) named list of grouping variable(s)

FUN

named list of statistics or functions

seconds

temporal resolution (to which timestamps are truncated)

...

further arguments to '[.data.table'

simplify

logical; drop unused columns (unimplemented)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
require(zoo)
require(lubridate)
data(co2)
x <- ISOdate(1959, 01, 01, 00) + dyears(index(as.zoo(co2)) - 1959)
co2 <- as.tsdb(data.frame(timestamp=x, value=as.numeric(co2)))
aggregate(co2, seconds=60 * 60 * 24 * 365 * 5)

## End(Not run)

holstius/opentsdbr documentation built on May 17, 2019, 4:50 p.m.