| ClimateBlock | R Documentation |
An Rcpp module class exposing the C++ ClimateBlock implementation of
the xbioclim library. Accepts four n_pixels x 12 matrices of monthly
climate data and computes all 19 bioclimatic variables for each pixel via a
compiled C++ back-end.
ClimateBlock is loaded into the package namespace when the package
is attached (via loadModule in .onLoad).
new(ClimateBlock, tas, tasmax, tasmin, pr) returns an Rcpp
module object of class ClimateBlock. Its $n_pixels() method
returns a single integer and its $compute() method returns an
n_pixels x 19 numeric matrix with columns named bio01
through bio19.
new(ClimateBlock, tas, tasmax, tasmin, pr)
tasNumeric matrix of dimensions n_pixels x 12:
monthly mean temperature for each pixel.
tasmaxNumeric matrix of dimensions n_pixels x 12:
monthly maximum temperature for each pixel.
tasminNumeric matrix of dimensions n_pixels x 12:
monthly minimum temperature for each pixel.
prNumeric matrix of dimensions n_pixels x 12:
monthly precipitation for each pixel.
All four matrices must have exactly 12 columns and the same number of rows.
n_pixels()Returns the number of pixels (integer).
compute()Computes the 19 bioclimatic variables for all
pixels and returns an n_pixels x 19 numeric matrix with columns
named bio01 through bio19.
tas <- matrix(rep(1:12, 3), nrow = 3, byrow = TRUE)
tasmax <- tas + 1
tasmin <- tas - 1
pr <- matrix(rep(1:12, 3), nrow = 3, byrow = TRUE)
block <- new(ClimateBlock, tas, tasmax, tasmin, pr)
block$n_pixels() # 3
result <- block$compute() # 3 x 19 matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.