Aggregates a data frame to annually resolution
agg2annually(df, col_name, fun, allow_na = 0, start_month = 1, end_month = 12)
A data frame with the Date and the aggregated variable(s).
data frame with class Date or POSIXct in the first column.
string (vector) with the name(s) of the column(s) to aggregate.
string (vector) containing the name(s) of function(s) to use: mean, min, max, sum, last or first.
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).
numeric value defining the first month of the annually period. Default sets to 1 (January).
numeric value defining the last month of the annually period. Default sets to 12 (December).