Nothing
#' Generate a random sample from a truncated normal distribution.
#'
#' @param mean the mean of the normal distribution
#' @param variance The variance of the normal distribution
#'
#' @return A random sample from the specified truncated normal distribution
#'
#' @example tests/testthat/examples_fcn_doc/examples_getTruncatedNormal.R
#' @export
#' @keywords internal
getTruncatedNormal <- function(mean,variance){
while(TRUE){
n = mean+randn(1,1)*sqrt(variance)
if((sign(n)==sign(mean))){
break
}
}
return( n)
}
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.