View source: R/diversity_range_analysis.R
| diversity_range_analysis | R Documentation |
diversity_range_analysis biodiversity indices related to diversity-range plots
diversity_range_analysis( pam, xy_mat = NULL, lower_interval = 0.05, upper_interval = 0.95, raster_templete = NULL, niter = 100, return_null_dfield = FALSE, parallel = TRUE, n_cores = 2 )
pam |
A Presence-Absence-Matrix of matrix class or sparse matrix. |
xy_mat |
A two dimensional matrix with longitude and latitude data. |
lower_interval |
Lower interval. |
upper_interval |
Upper interval. |
raster_templete |
Araster templete. |
niter |
Number of iterations to obtain the distribution. |
return_null_dfield |
If TRUE the null distribution of dispersal field will be returned. |
parallel |
If TRUE the computations will be performed in parallel. |
n_cores |
Number of cores for the parallel computation. |
## Not run:
set.seed(111)
pam <- matrix(rbinom(10000,1,0.5),nrow = 100,ncol = 1000)
rdivan <- diversity_range_analysis(pam=pam,parallel = FALSE,
return_null_dfield=TRUE)
bam::plot(rdivan,plot_type="diversity_range")
# Lagomorphos
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) >0.01
nonas <- which(!is.na(en_models[[1]][]))
xy_mat <- sp::coordinates(en_models[[1]])[ nonas,]
pam <- bam::models2pam(en_models,sparse=FALSE)
rdivan <- diversity_range_analysis(pam=pam,parallel = FALSE,
xy_mat=xy_mat,
raster_templete = en_models[[1]],
return_null_dfield=TRUE)
bam::plot(rdivan,plot_type="diversity_range")
bam::plot(rdivan,plot_type="diversity_range_map")
bam::plot(rdivan,plot_type="diversity_range_interactive")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.