time_aggregate: Aggregate a time series

View source: R/time_aggregate.R

time_aggregateR Documentation

Aggregate a time series

Description

The time series x is aggregated by an integer factor n.

Usage

time_aggregate(data, n = 2)

Arguments

data

POSIXct vector, time to be processed.

n

Numeric value, number of samples to be aggregated to one new data value. Must be an integer value greater than 1. Default is 2.

Value

POSIXct vector, aggregated data.

Author(s)

Michael Dietze

Examples


## load example data set
data(rockfall)

## aggregate time series
rockfall_t_agg <- time_aggregate(data = rockfall_t, 
                          n = 2)

## compare results
range(rockfall_t)
diff(rockfall_t)

range(rockfall_t_agg)
diff(rockfall_t_agg)


coffeemuggler/eseis documentation built on Aug. 19, 2023, 9:57 p.m.