model_path <- system.file("extdata/Lepus_californicus_cont.tif",
package = "bamm")
model <- raster::raster(model_path)
sparse_mod <- bamm::model2sparse(model,0.1)
adj_mod <- bamm::adj_mat(sparse_mod,ngbs=2)
occs_lep_cal <- data.frame(longitude = c(-115.10417,
-104.90417),
latitude = c(29.61846,
29.81846))
occs_sparse <- bamm::occs2sparse(modelsparse = sparse_mod,
occs = occs_lep_cal)
sdm_lep_cal <- bamm::sdm_sim(set_A = sparse_mod,
set_M = adj_mod,
initial_points = occs_sparse,
nsteps = 50)
# \donttest{
if(requireNamespace("animation")){
ani_name <- tempfile(pattern = "simulation_",fileext = ".html")
#sdm_lep_cal_st <- bamm::sim2Animation(sdm_simul = sdm_lep_cal,
# which_steps = seq(1,50,by=1),
# fmt = "HTML",ani.width = 1200,
# ani.height = 1200,
# filename = ani_name)
}
# }
Run the code above in your browser using DataLab