resample_and_aggregate: Resample time series to new ISO 8601 timestep

View source: R/preparation.R

resample_and_aggregateR Documentation

Resample time series to new ISO 8601 timestep

Description

Time series resampled to the desired timestep and the values are aggregated using the aggregation function defined. Timestep of the original series must be shorter than the output timestep of the series.

Usage

resample_and_aggregate(data, timestep, func, minRatio = 0, estimate = T)

Arguments

data

<data.frame> describing the input time series to be resampled. Time column: 'time', value column: 'value'. If you use weighted average aggregation, you must include a column in data named 'weights'.

func

<string> A string defining the function to use in aggregate (options are: "SUM" to sum up the values at each time step,"WEIGHTED-AVG" to calculate the weighted average of the values at each time step, "AVG" to calculate the mean of the values at each time step).

minRatio

<float> Minimum percentage of known values in a timestep to calculate the desired aggregation. Default is 0%. Unit is percentage.

estimate

<boolean> defining if the output value should be an estimated value (theoretical linear approximation considering the time step) or the real value (gaps are unconsidered, if they exist).

timeStep

<string> A string in ISO 8601 format representing the period or timestep (e.g. "PT15M","PT1H", "P3M", "P1D" ,...).

Value

<data.frame> corresponding to the resampled and aggregated time series


biggproject/biggr documentation built on Oct. 2, 2024, 11:13 p.m.