View source: R/discretise_habitat.R
discretise_habitat | R Documentation |
Title
discretise_habitat(
habitat,
max_size = as_units(5, "km^2"),
min_size = as_units(0.5, "km^2"),
patch_density = as_units(1, "1/km^2"),
raster_size = as_units(0.05, "km^2"),
raster_shape = c("hexagons", "squares"),
h_adj = 0.5,
point_density = as_units(100, "1/km^2"),
verbose = 2L
)
habitat |
an sf data frame with active geometry column and Density column |
max_size |
maximum (approximate) size of output patches |
min_size |
minumum (approxiamte) size of output patches |
patch_density |
assumed density of output patches in terms of carrying capacity per km^2 |
raster_size |
size of hexagons/squares used for rasterisation |
raster_shape |
one of hexagons or squares |
h_adj |
adjustment of the bandwidth used by |
point_density |
density of points used for kde2d and k-means clustering |
verbose |
verbocity setting (0 = silent) |
Then do a kernal density estimation:
The x/y dimensions depend on square vs hexagon:
TODO: the value chosen for h affects the extent of smoothing (currently half the default value)
TODO: for hexagons scale y h so that it is equivalent to x h i.e. accounts for aspect ratio
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.