bam_clusters: bam_clusters: Function to estimate the connectivity of...

View source: R/bam_clusters.R

bam_clustersR Documentation

bam_clusters: Function to estimate the connectivity of suitable areas

Description

Function to estimate the connectivity of suitable areas given an adjacency matrix.

Usage

bam_clusters(model, ngbs = 1, plot_model = FALSE)

Arguments

model

A niche model in raster format

ngbs

Numeric. Number of neighbors (see details).

plot_model

Logical. Indicates whether to plot the model in the cluster map.

Details

The grid_base raster object is the area where the dispersal process will occur. The number of neighbors depends on the dispersal abilities of the species and the spatial resolution of the grid_base; for example, a species's with big dispersal abilities will move throughout more than 1 km^2 per day, so the idea is to give an approximate number of moving neighbors (pixels) per unit of time.

Value

A list with a data.frame of the coordinates of each cluster and a leaflet map.

Examples


## Not run: 
model_path <- system.file("extdata/Lepus_californicus_cont.tif",
                          package = "bam")
model <- raster::raster(model_path)
model <- model > 0.7
clusterin <- bam_clusters(model,ngbs=1,plot_model=T)
clusterin@interactive_map

## End(Not run)

luismurao/bam documentation built on Nov. 28, 2022, 3:02 p.m.