if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- intModel(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startISDM(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startMarks(data, Mesh = mesh,
Projection = proj, responsePA = 'Present',
markNames = 'speciesName',
markFamily = 'multinomial')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb',
diagonal = 1)))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions)
}
}
if (FALSE) {
if (requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startSpecies(data, Mesh = mesh, Coordinates = c('X', 'Y'),
Projection = proj, responsePA = 'Present')
##Run the model
modelRun <- fitISDM(organizedData, options = list(control.inla = list(int.strategy = 'eb')))
#Predict spatial field on linear scale
predictions <- predict(modelRun, mesh = mesh, spatial = TRUE, fun = 'linear')
#Make generic plot of predictions
plot(predictions, colourHigh = 'red', colourLow = 'orange')
}
}
Run the code above in your browser using DataLab