R/esw_hn.R

Defines functions esw_hn

Documented in esw_hn

# Generated by fusen: do not edit by hand


#' Calculate the effective strip width of a half normal function
#'
#' This 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.
#' @param sigma numeric. Sigma of half normal function.
#'
#' @importFrom stats pnorm dnorm
#' @importFrom assertthat assert_that
#'
#' @return numeric. esw in km associated to the sigma given.
#' @export

#' @examples
#' 
#' esw_hn(sigma = 0.3)
#' 
#' # esw of 0.376 km
#' 
esw_hn <- function(sigma){
  
  assert_that(is.numeric(sigma))
  
  esw <- (pnorm(+Inf, 0, sigma) - 0.5) / dnorm(0, 0, sigma)
  return(esw)
  
  }
maudqueroue/intercali documentation built on Oct. 8, 2022, 2:09 p.m.