Skip to contents

Constructs a BioclimModel-class S4 object backed by a C++ BioclimModel instance. The four monthly climate arrays are validated and passed to the C++ object; all bioclimatic variable computations delegate to that object via Rcpp.

Usage

BioclimModel(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 BioclimModel-class object.

Examples

tas    <- 1:12
tasmax <- 2:13
tasmin <- 0:11
pr     <- 1:12
m <- BioclimModel(tas, tasmax, tasmin, pr)
bio01(m)
#> [1] 6.5
bioclim(m)
#>     bio01     bio02     bio03     bio04     bio05     bio06     bio07     bio08 
#>   6.50000   2.00000  15.38462 345.20525  13.00000   0.00000  13.00000  11.00000 
#>     bio09     bio10     bio11     bio12     bio13     bio14     bio15     bio16 
#>   2.00000  11.00000   2.00000  78.00000  12.00000   1.00000  53.10850  33.00000 
#>     bio17     bio18     bio19 
#>   6.00000  33.00000   6.00000