Learn R Programming

geohabnet

This package expands on Xing et al (2021). It adds capabilities to customize parameter values using functions and shows the results of habitat connectivity risk index in the form of plots. The goal of geohabnet is to enable users to visualize a habitat connectivity risk index using their own parameter values. The risk analysis outputs 3 maps -

  1. Mean habitat connectivity (based on a habitat connectivity index defined by the user)

  2. Difference in habitat connectivity

  3. Variance in habitat connectivity

This package currently supports crop maps sourced from geodata::monfredaCrops() and geodata::spamCrops(). This analysis produces the 3 maps listed above. There are multiple ways in which functions can be used - generate the final outcome and then the intermediate outcomes for more sophisticated use cases. The vignettes provide several examples. The output values are propagated to other functions for performing operations such as distance matrix calculation. The values are set in parameters.yaml and it can be accessed using get_parameters(). See the usage below.

Installation

Package can either be installed from CRAN:

install.packages("geohabnet")
#> Installing package into '/private/var/folders/r5/zggvft9d3yn5kh51wqp78rd00000gn/T/RtmpBU77e3/temp_libpath4f5365f57439'
#> (as 'lib' is unspecified)
#> 
#> The downloaded binary packages are in
#>  /var/folders/r5/zggvft9d3yn5kh51wqp78rd00000gn/T//RtmpBqmkXl/downloaded_packages

or the source version of package can be installed from GitHub with:

if (!require("devtools")) {
  install.packages("devtools")
}

devtools::install_github("GarrettLab/HabitatConnectivity", subdir = "geohabnet")

geohabnet Example

library(geohabnet)

param_file <- geohabnet::get_parameters()
# now edit the file
geohabnet::set_parameters(new_params = param_file)

Run the analysis using -

geohabnet::sensitivity_analysis()

parameters.yaml stores the parameter and its values. It can be accessed and set using get_parameters() and set_parameters() respectively. By default risk analysis is run on global index, for which scales are present in global_scales() .

Refer to help using ?geohabnet::fun or help(geohabnet::fun)

Refer to article Analyzing risk index using cropland connectivity for more elaborate description and usages of functions in this package.

Copy Link

Version

Install

install.packages('geohabnet')

Monthly Downloads

497

Version

2.1.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Krishna Keshav

Last Published

June 27th, 2024

Functions in geohabnet (2.1.3)

STR_PAGE_RANK

global variable containing string. Not intended to modify.
STR_EIGEN_VECTOR_CENTRALITY

global variable containing string. Not intended to modify.
global_scales

Global geographical extent
gplot

Plot a Raster* object
%>%

Pipe operator
geohabnet-package

geohabnet: Geographical Risk Analysis Based on Habitat Connectivity
nn_sum

Calculation on network metrics a.k.a centralities.
hci_mean

Calculate mean of raster objects
hci_diff

Calculate difference map
ndplot

Network density
STR_NEAREST_NEIGHBORS_SUM

global variable containing string. Not intended to modify.
STR_DISTANCE_MATRIX

global variable containing string. Not intended to modify.
connectivity

Calculate and plot maps
mapspam

Supported sources for Mapspam
load_parameters

Load Parameters from YAML File
STR_EAST

global variable containing string. Not intended to modify.
get_parameters

Get Parameters
search_crop

Search for crop
sean

Sensitivity analysis across maps of habitat connectivity
get_rasters

Get rasters object from parameters
set_parameters

Set Parameters
geoscale_param

Get geographical scales from the parameters
hci_variance

Calculate variance of CCRI
reso

Get resolution value
sensitivity_analysis

Sensitivity analysis for habitat connectivity
reset_params

Reset parameters.yaml
set_global_scales

Set global geographical extent
sa_onrasters

Run sensitivity analysis
host_density<-

Set the host density.
monfreda

Supported sources for monfreda
risk_indices

Get risk indices
setprops,GeoModel,character,numeric,numeric-method

Set properties of the GeoModel object.
supported_sources

Get supported sources of crops
tiff_torast

Get raster object from tif file
dist_methods

Distance methods supported
setprops

Set properties of the GeoModel object.
ndplot,GeoNetwork-method

Network density
setmaps,Gmap-method

Sets the map slots in the Gmap object.
.indices

Internal function to extract risk indices from a list of crop rasters.
sp_rast

Raster for mapspam crop.
supported_metrics

Returns metrics currently supported in the analysis.
scales

Only meant to global variables
STR_BETWEENNESS

global variable containing string. Not intended to modify.
GeoModel-class

GeoModel class
GlobalRast-class

GlobalRast class
Gmap-class

Gmap class
GeoNetwork-class

GeoNetwork
RiskMap-class

RiskMap class
GeoRasters-class

GeoRaster class
inv_powerlaw

Dispersal kernels
STR_CLOSENESS_CENTRALITY

global variable containing string. Not intended to modify.
STR_WEST

global variable containing string. Not intended to modify.
STR_DEGREE

global variable containing string. Not intended to modify.
cropharvest_rast

Get raster object for crop
STR_NODE_STRENGTH

global variable containing string. Not intended to modify.
crops_rast

Get sum of rasters for individual crops