The goal of LobsterHSI is to calculate Suitability Index (SI) values and plot Habitat Suitability Index (HSI) maps.
You can install the development version of LobsterHSI from GitHub with:
# install.packages("pak")
pak::pak("XiangyanYang/LobsterHSI")
This is a basic example which shows you how to use code:
devtools::load_all()
#> ℹ Loading LobsterHSI
library(LobsterHSI)
## basic example code
data("Lobster_SI_9020")
data("LobsterHSI_mapData")
SIData=SIcurve(surveydata = Lobster_SI_9020,
envVariable = c("Latitude","Longitude","Depth", "SST"),
int_n = 20,
Seasons =c("Spring","Fall"))
plots=plot_SI_curves(surveydata = Lobster_SI_9020,
envVariable = c("Latitude","Longitude","Depth", "SST"),
int_n = 20,
Seasons =c("Spring","Fall"),
filename = "SI_curves.jpg")
# for project users, define months 1-6 as spring, define months 7-12 as fall
# data("LobsterHSI_monthData")
# LobsterHSI_mapData <- LobsterHSI_monthData %>%
# dplyr::mutate(Season = case_when(
# Month %in% c(1:6) ~ "Spring",
# Month %in% c(7:12) ~ "Fall",
# TRUE ~ NA_character_))%>%
# dplyr::select(-Month)
HSI <- get_HSI(surveydata = Lobster_SI_9020,
MapData = LobsterHSI_mapData,
envVariable = c("Latitude","Longitude","Depth", "SST"),
int_n = 20,
Seasons =c("Spring","Fall"),
weights=c(0.25,0.25,0.25,0.25))
HSImap=HSImap(surveydata = Lobster_SI_9020,
MapData = LobsterHSI_mapData,
envVariable = c("Latitude","Longitude","Depth", "SST"),
Seasons =c("Spring","Fall"),
int_n = 20,
weights=c(0.25,0.25,0.25,0.25),
filename="HSIplot.jpg")
#> [using ordinary kriging]
#> [using ordinary kriging]
example plots:
#> png
#> 2
#> [using ordinary kriging]
#> [using ordinary kriging]
#> png
#> 2