Nothing
#' Calculating a distance decay weight
#'
#' A function to calculate, with a negative exponential or Gaussian dispersal kernel.
#'
#' @param s A numeric scalar indicating spatial distance at which the distance decay is referred
#' @param a A numeric scalar indicating a decay coefficient
#' @param kernel An option to select a negative exponential \code{"exp"} or Gaussian \code{"gaussian"} for a dispersal kernel of neighbor effects.
#' @return A numeric scalar for a distance decay weight.
#' @author Yasuhiro Sato (\email{sato.yasuhiro.36c@kyoto-u.jp})
w = function(s,a,kernel=c("exp","gaussian")) {
kernel <- match.arg(kernel)
if(kernel=="exp") {
return(exp(-(s/a)))
} else { # if(kernel=="gaussian") {
return(exp(-(s^2/a^2)))
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.