agg2hourly: Aggregates a data frame to hourly resolution

View source: R/aux_agg2hourly.R

agg2hourlyR Documentation

Aggregates a data frame to hourly resolution

Description

Aggregates a data frame to hourly resolution

Usage

agg2hourly(df, col_name, fun, allow_na = 0)

Arguments

df

data frame with class Date or POSIXct in the first column.

col_name

string (vector) with the name(s) of the column(s) to aggregate.

fun

string (vector) containing the name(s) of function(s) to use: mean, min, max, sum, last or first.

allow_na

optional. Numeric value with the maximum allowed number of NA_real_ values. By default the function will not tolerate any NA_real_ in an aggregation period (and will return NA_real_ instead).

Value

A data frame with the Date and the aggregated variable(s).


hydrotoolbox documentation built on April 14, 2023, 12:34 a.m.