Function to generate Kernel Density plot from Beaver Forage Data
forage_density.Rd
This function allows users to generate a kernel density raster from a collection of points.
Usage
forage_density(
forage_points,
impact_cat,
grid_size = 20,
kern_bw = 250,
kd_extent,
kd_weights = c(1, 1000, 1e+06),
low_thresh = 1e-12,
standardise = FALSE
)
Arguments
- forage_points
The foraging sign point data - must be either an sf object or an sf-readable file. See sf::st_drivers() for available drivers
- impact_cat
A character vector of length one containing the column name which describes the feeding impact category (i.e. Low, Medium, or High). If not provided kernel density is not weighted
- grid_size
The raster grid cell size desired.
- kern_bw
The bandwidth for the kernel denisty search radius.
- kd_extent
The desired extent of the output raster.
- kd_weights
A numeric vector of length equal to the number of unique impact categories.
- low_thresh
A lower threshold for setting the minimum desired value. Values < low_thresh are set to NA.
- standardise
Boolean to specify if densities shoul be standardised between 0-1.
Examples
# Here we filter the filter the built in 2019-2020 ROBT feeding sign data `RivOtter_FeedSigns`
# Then pipe this 'sf' object to forage_density.
RivOtter_FeedSigns %>%
dplyr::filter(SurveySeason == "2019 - 2020")%>%
forage_density(., 'FeedCat')
#> No value supplied for "kd_extent" argument: default extent will be used
#>
#> calculating weighted kde
#> class : SpatRaster
#> size : 910, 1573, 1 (nrow, ncol, nlyr)
#> resolution : 11.57761, 34.60946 (x, y)
#> extent : 304974.2, 323185.8, 82922.7, 114417.3 (xmin, xmax, ymin, ymax)
#> coord. ref. : OSGB 1936 / British National Grid (EPSG:27700)
#> source(s) : memory
#> name : z
#> min value : 1.000000e-10
#> max value : 3.242415e+02