Calculate Daily Sums or Averages

Description

Calculate daily sums or averages, e.g. from from hourly irradiation data.

Usage

1
aggregate_daily(time, y, basedate, FUN = sum)

Arguments

time

vector of POSIXct times

y

corresponding vector of data (e.g. hourly)

basedate

reference date where the series starts from, e.g., "1970-01-01 00:00.00 UTC"

FUN

function that is applied to the data of each day

Value

Data frame with the following columns:

day

POSIXct time of the days

y

vector of aggregated values

Examples

1
2
3
## global hourly irradiation data
data(irad)
daily <- aggregate_daily(irad$time, irad$irad2, basedate= "1970-01-01 00:00.00 UTC")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.