The 'habitat' R Package is a straightforward and user-friendly tool designed to help users quickly analyze and interpret habitat changes with minimal effort. Tailored for new users, those unfamiliar with complex geospatial analysis workflows, and researchers, this package streamlines the process of comparing habitat changes and distributions between current and future scenarios.
- Minimal Setup: Input raster layers, set a threshold, and get instant results.
- Fast Raster Modification: Easily modify raster parameters such as CRS, extent, resolution, and apply crop and mask in one line of code.
- Comprehensive Metrics: Gain insights into habitat loss, gain, stability, and net change percentages and areas.
- Seamless Visualization: Generate professional-grade plots with a single command.
- Integration with sdm Package: Obtain raster results from the sdm package along with various threshold metrics for calculating, analyzing, and visualizing habitat changes.
- Ready-to-Export Outputs: Save results in common formats like CSV and TXT for reporting or further analysis.
We welcome contributions from the community! If you have any suggestions or improvements, please infrom us! samangh.edu@gmail.com
If you use habitat in your research, please cite it as follows: Ghasemian Sorboni, S., Hadipour, M., & Pourebrahim, S. (2024). habitat: An R Package for Analyzing and Comparing Habitat Changes. dataset. doi:.
install the package from GitHub:
# Install devtools if you haven't already
install.packages("devtools")
devtools::install_github("samanghs/habitat")
# Example
library(habitat)
current_raster <- rast(nrows=10, ncols=10, vals=sample(c(0, 1), 100, replace=TRUE))
future_raster <- rast(nrows=10, ncols=10, vals=sample(c(0, 1), 100, replace=TRUE))
result <- habitat_range(current_raster, future_raster, threshold=0.5)
print(result)