View source: R/betadiv_disparity.R
betadiv_disparity | R Documentation |
Change in morphological disparity is calculating across a
moving window of neighboring grid cells. To implement a custom function,
see customBetaDiv
.
betadiv_disparity(x, radius, slow = FALSE, nThreads = 1)
x |
object of class |
radius |
Radius of the moving window in map units. |
slow |
if TRUE, use an alternate implementation that has a smaller memory footprint but that is likely to be much slower. Most useful for high spatial resolution. |
nThreads |
number of threads for parallelization |
For each gridcell neighborhood (defined by the radius), we calculate the proportion of the full disparity contained in those grid cells, and then take the standard deviation of those proportions across the gridcell neighborhood. This way, the returned values reflect how much disparity (relative to the overall total disparity) changes across a moving window.
If the R package spdep is installed, this function should run more quickly.
Returns a sf polygons object (if hex grid) or a SpatRaster object (if square grid).
Pascal Title
Foote M. 1993. Contributions of individual taxa to overall morphological disparity. Paleobiology. 19:403–419.
tamiasEPM
tamiasEPM <- addTraits(tamiasEPM, tamiasTraits)
z <- betadiv_disparity(tamiasEPM, radius = 150000)
plot(z)
# using square grid epmGrid
tamiasEPM2 <- createEPMgrid(tamiasPolyList, resolution = 50000,
cellType = 'square', method = 'centroid')
tamiasEPM2 <- addTraits(tamiasEPM2, tamiasTraits)
z2 <- betadiv_disparity(tamiasEPM2, radius = 150000)
terra::plot(z2, col = sf::sf.colors(100))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.