The 'habitat' R Package is a straightforward and accessible tool designed to help users quickly analyze and interpret habitat changes with minimal effort. Specifically tailored for new users and those unfamiliar with complex geospatial analysis workflows, this package streamlines the process of comparing habitat 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.
- Ready-to-Export Outputs: Save results in common formats like CSV and TXT for reporting or further analysis.
install the package from GitHub:
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)