quarterly_variables: Quarterly / seasonal climate variables

View source: R/quarterly.R

quarterly_variablesR Documentation

Quarterly / seasonal climate variables

Description

Computes six quarterly/seasonal variables for an arbitrary set of months.

Usage

quarterly_variables(tas, tasmax, tasmin, pr, months, na.rm = FALSE, ...)

## Default S3 method:
quarterly_variables(tas, tasmax, tasmin, pr, months, na.rm = FALSE, ...)

Arguments

tas

Numeric vector (length 12), matrix (pixels x 12), SpatRaster with 12 layers, or BioclimData.

tasmax

Same form as tas: monthly maximum temperature.

tasmin

Same form as tas: monthly minimum temperature.

pr

Same form as tas: monthly precipitation.

months

Integer vector of 1-based month indices to include (e.g. c(1, 2, 3) for a fixed quarter, or c(12, 1, 2) for DJF).

na.rm

Logical. If FALSE (default), a single NA among the selected months makes all outputs NA for that pixel. If TRUE, missing months are skipped.

...

Not currently used.

Details

The output variables are:

  • tmean_s — mean tas over the selected months.

  • tmax_max — maximum monthly tasmax among the selected months.

  • tmin_min — minimum monthly tasmin among the selected months.

  • trange — tmax_max - tmin_min.

  • pr_tot — total pr over the selected months.

  • pr_cv — coefficient of variation of monthly pr (100 * sd_pop / mean), matching the BIO15 scaling.

Use quarterly_fixed() for the four standard fixed quarters and quarterly_rolling() for rolling 3-month windows.

Value

  • Vector input: a named numeric vector of length 6.

  • Matrix / BioclimData input: a numeric matrix (pixels x 6) with columns tmean_s, tmax_max, tmin_min, trange, pr_tot, pr_cv.

  • SpatRaster input: a 6-layer SpatRaster with the same geometry and the same names.


xbioclim documentation built on Oct. 5, 2026, 5:08 p.m.