| pam2richness | R Documentation |
Converts Presence Absence Matrix (pam object) to richness raster
pam2richness(pamobj, which_steps)
pamobj |
An object of class pam see |
which_steps |
Time steps in the pam to convert |
## Not run:
library(bam)
lagos_path <- system.file("extdata/conejos",
package = "bam")
enm_path <- list.files(lagos_path,
pattern = ".tif",
full.names = TRUE)
en_models <- raster::stack(enm_path)
ngbs_vect <- sample(1:2,replace = T,
size = raster::nlayers(en_models))
init_coords <- read.csv(file.path(lagos_path,
"lagos_initit.csv"))
nsteps <- 30
sdm_comm <- community_sim(en_models = enm_path,
ngbs_vect = ngbs_vect,
init_coords = init_coords,
nsteps = nsteps,
threshold = 0.1)
pams <-csim2pam(community_sim = sdm_comm ,
which_steps = c(1:20))
richness_stack <- pam2richness(pams,which_steps=pams@which_steps)
raster::plot(richness_stack)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.