Learn R Programming

divraster

Alpha and beta calculations using rasters for taxonomic (TD), functional (FD), and phylogenetic (PD) dimensions. Spatial and temporal beta diversity can be partitioned into replacement and richness difference components. Functions to calculate standardized effect size for functional and phylogenetic alpha diversity and the average traits are available.

Installation

The CRAN version of divraster can be installed using:

install.packages("divraster")

The development version of divraster can be installed from Github using:

devtools::install_github("flaviomoc/divraster")

divraster basics

Basic information about divraster can be found at the package's webpage or in the vignette:

vignette("divraster-vignette")

Citation

  • If you use this R package, please cite in your publications:

Mota FMM, Alves-Ferreira G, Talora DC, Heming NM (2023). divraster: an R package to calculate taxonomic, functional and phylogenetic diversity from rasters. -- Ecography, e06905.

  • For more information:
citation("divraster")

Issues

If you have any question or find any bug, let us know through the topic Issues.

Copy Link

Version

Install

install.packages('divraster')

Monthly Downloads

468

Version

1.2.3

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Flávio Mota

Last Published

January 11th, 2026

Functions in divraster (1.2.3)

temp.beta.vec

Temporal beta diversity calculation for vector
combine.rasters

Combine GeoTIFF rasters into a multilayer SpatRaster
area.calc

Calculate SpatRaster Layer Areas and Overlap Areas
inputs_chk

Check if objects are valid
differ.rast

Calculate Absolute or Percentage Difference Between SpatRaster Objects
load.data

Load data adapted from Mota et al. (2025), Şekercioğlu et al. (2025), Mota et al. (2022), Tobias et al. (2022), and Jetz et al. (2014)
area.calc.flex

Flexible Area Calculation for Raster
occ.avg.dist

Average pairwise distance between occurrences by species
rast.by.polys

Summarise raster values by polygons
spat.alpha

Alpha calculation for raster
spat.trait

Average trait calculation for raster
spat.rand

Standardized Effect Size (SES) for raster
spat.beta

Spatial beta diversity for raster
spat.alpha.vec

Alpha calculation for vector
spat.alpha2

Alternative Method to Calculate Alpha Taxonomic Diversity
suit.change

Species Suitability Change Between Climate Scenarios
spat.trait.vec

Average trait calculation for vector
area.interval

Calculate Area by Interval Classes for SpatRasters
bin2crop

Crop a continuous raster by a binary (0/1) raster footprint (value == 1)
temp.beta

Temporal beta diversity calculation for raster