Skip to contents

Installation and loading

geohabnet is currently a private package and thus requires an access to github repo . Please request an access from Garrett,Karen <karengarrett@ufl.edu> .

Replace the auth token with your own token obtained from github.

if (!require("geohabnet")) {
  devtools::install_github("GarrettLab/CroplandConnectivity", subdir = "geohabnet")
}
#install.packages("geohabnet") # do not run this
library(geohabnet)
interactive()

Run analysis on initial values. If the function executes successfully, resulting maps will be saved under ./plots/ directory as raster files(.tif extension). Refer to the messages for their exact name.

Check if crop data exists in supported data sources.

search_crop("avocado")

Create new raster

myrast <- get_rasters(list(monfreda = c("avocado")))[[1]]
# visualizing the intial raster
terra::plot(myrast)

Modify link weights. Link weights are used as threshold for cell values in the raster. These cell values are filtered on the basis of link and host density thresholds. Use the raster created earlier above for new analysis. If the threshold is too big, then it may result in valid cells to produce connectivity.

results <- sean(link_threshold = 0.0000015, rast = myrast, res = 24)