knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
geodiv calculates gradient surface metrics in R. These metrics are applied to continuous spatial data (i.e., rasters or matrices) and represent spatial heterogeneity.
You can install the released version of geodiv from CRAN with:
install.packages("geodiv")
And the development version from GitHub with:
# install.packages("devtools") # install from master branch devtools::install_github("bioXgeo/geodiv") # install from development branch devtools::install_github("bioXgeo/geodiv",ref = "dev")
On Mac OS X, you may need to install the development tools here to get the package to install:
https://cran.r-project.org/bin/macosx/tools/
This is a basic example which shows you how to calculate several metrics over an entire image. geodiv may also be applied with moving windows over an entire image using the 'texture_image' function. For a more complex example, see the vignette.
library(geodiv) # import example raster data(normforest) # apply metrics sa(normforest) # average surface roughness svk(normforest) # reduced valley depth ssc(normforest) # mean summit curvature
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.