Skip to contents

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)
#>      bio01      bio02      bio03      bio04      bio05      bio06      bio07 
#>  14.666667   9.083333  29.301075 682.316316  32.000000   1.000000  31.000000 
#>      bio08      bio09      bio10      bio11      bio12      bio13      bio14 
#>   7.000000  23.666667  23.666667   6.000000 455.000000  65.000000   5.000000 
#>      bio15      bio16      bio17      bio18      bio19 
#>  51.765124 180.000000  30.000000  30.000000 180.000000