bioclim_block: Create a C++ ClimateBlock and compute bioclimatic variables

View source: R/bioclim_module.R

bioclim_blockR Documentation

Create a C++ ClimateBlock and compute bioclimatic variables

Description

A convenience wrapper around the C++ ClimateBlock class exposed by the bioclim_mod Rcpp module. Accepts the same four monthly climate vectors as bioclim but delegates the computation to the compiled C++ back-end via Rcpp.

Usage

bioclim_block(tas, tasmax, tasmin, pr)

Arguments

tas

Numeric vector of length 12: monthly mean temperature.

tasmax

Numeric vector of length 12: monthly maximum temperature.

tasmin

Numeric vector of length 12: monthly minimum temperature.

pr

Numeric vector of length 12: monthly precipitation.

Value

A named numeric vector of length 19 (bio01 through bio19), identical in meaning to the output of bioclim.

Examples

tas    <- c(5, 7, 10, 14, 18, 22, 25, 24, 20, 15, 10, 6)
tasmax <- c(8, 10, 14, 18, 23, 28, 32, 31, 26, 19, 13, 9)
tasmin <- c(1,  3,  6, 10, 13, 17, 20, 19, 15, 10,  6, 2)
pr     <- c(60, 55, 50, 40, 30, 15,  5, 10, 25, 45, 55, 65)
bioclim_block(tas, tasmax, tasmin, pr)

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