knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(intercali)
The detection_function
is use to simulate the probability that a individual could be observed according to the sample design. The detection function could be an uniform detection function with a probability of detection g_zero
on the whole strip band until the maximum distance of observation (in m) truncation_m
. The detection function could also be a half normal detection function for which we can choose the effective strip width (in km) esw_km
i.e. the distance at which there are as much non detected individuals before this distance than detected individuals after this distance. For the half normal detection function it is also possible to choose the proability of detection at 0 meter g_zero
and the maximum distance of observation (in m) truncation_m
.
Two examples of this function using a dataset dataset_dist
created with theintercali
package. The first example is a half normal detection hn
with a effective strip probability esw_km
of 0.16km, and a truncation truncation_m
of 400m. The second exemple use a uniform detection unif
with a probability of 0.8 g_zero
and a truncation of 250m.
library(ggplot2) data(dataset_dist) detected <- detection(dist_obj = dataset_dist, key = "hn", esw_km = 0.16, g_zero = 1, truncation_m = 400) ggplot(detected, aes(x=distance_m, y=proba)) + geom_point(color = "indianred4") + xlim(0,500) detected <- detection(dist_obj = dataset_dist, key = "unif", g_zero = 0.8, truncation_m = 250) ggplot(detected, aes(x=distance_m, y=proba)) + geom_point(color = "indianred4") + xlim(0,500)
The esw_hn
function comes from the pelaDSM
package. This functions allows to calculate the effective strip width corresponding to the sigma
of a half normal detection function.
The effective strip width corresponding to a sigma
of 0.3 in a half-normal detection function is given by esw_hn
.
esw_hn(sigma = 0.3) # esw of 0.376 km
The scale_hn
function comes from the pelaDSM
package. This functions allows to calculate the sigma of a half normal detection function according to the effective strip width esw
decided for the detection quality.
The value of sigma corresponding to a effective strip width esw
of 160m is given by scale_hn
.
scale_hn(esw = 0.16) # sigma = 0.128
The plot_detection
function allows to highligth individuals detected according to the sample design and the detection
function. The function represents on the study map, the different transects of the sample design and highligtht in dark blue the detected (simulated) individuals while other non detected (simulated) individuals are in grey.
Example of this function use the dataset_detected
containing a dataset of detected individuals created thanks to the detection function
. It also use a zigzag transects dataset_segs
created in the study area map_obj
thanks to the different transect functions. Individuals detected according to the sample design and the detection
function are highligthted in dark blue while other non detected individuals are in grey.
data("dataset_detected") data("dataset_segs") plot_detect(dist_obj = dataset_detected, transect_obj = dataset_segs, map_obj = dataset_map, title = "Detected individuals")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.