This package is expanded upon Xing et al
(2021).
It add capabilities to customize parameter values using functions and
see results of cropland connectivity risk index in the form of plots.
The goal of geohabnet
is to enable users to visualize cropland
connectivity risk index using their own parameter values. The risk
analysis includes 3 maps -
-
Mean cropland connectivity
-
Difference
-
Variance
Package currently support crops sourced from geodata::monfredaCrops()
and geodata::spamCrops()
. This analysis produces 3 maps - mean,
variance and difference for the crop risk index. There are multiple ways
in which functions can be used - generate final outcome and then the
intermediate outcomes for more sophisticated use cases. Refer to
vignettes. This values are propagated to other functions for performing
operations such distance matrix calculation. The values are set in
parameters.yaml
using and it can be accessed using get_parameters()
.
See the usage below.
Package can either be installed from CRAN:
install.packages("geohabnet")
#> Installing package into '/private/var/folders/r5/zggvft9d3yn5kh51wqp78rd00000gn/T/RtmpgAVmQR/temp_libpath15ebc6703a975'
#> (as 'lib' is unspecified)
#> installing the source package 'geohabnet'
or the source version of package can be installed from GitHub with:
if (!require("devtools")) {
install.packages("devtools")
}
#> Loading required package: devtools
#> Loading required package: usethis
devtools::install_github("GarrettLab/CroplandConnectivity", subdir = "geohabnet")
#> Downloading GitHub repo GarrettLab/CroplandConnectivity@HEAD
#> Error in utils::download.file(url, path, method = method, quiet = quiet, :
#> download from 'https://api.github.com/repos/GarrettLab/CroplandConnectivity/tarball/HEAD' failed
library(geohabnet)
param_file <- geohabnet::get_parameters()
#> parameters fetched successfully
# now edit the file
geohabnet::set_parameters(new_params = param_file)
#> [1] TRUE
Run the analysis using -
geohabnet::senstivity_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.