peak_month: Month of the largest long-term mean

View source: R/analysis.R

peak_monthR Documentation

Month of the largest long-term mean

Description

Month of the largest long-term mean

Usage

peak_month(data, value, by = c("latitude", "longitude"))

Arguments

data

Data frame with month and the by columns

value

Name of the column to use, for example monthly precipitation

by

Group columns. The default is each grid point.

Value

Data frame with the by columns, peak_month (1-12), peak_value and annual_total (sum of the 12 monthly means). When two months have the same mean, the first month is the peak.

Examples

df <- data.frame(latitude = 10, longitude = 70, month = 1:12, tp = c(1:6, 12:7))
peak_month(df, "tp")

varunayan documentation built on Oct. 30, 2026, 1:07 a.m.