R/pdirac.R

Defines functions pdirac

pdirac <- function(q, location, lower.tail = TRUE, log.p = FALSE)
{
  f <- array(data = 0.0, dim = length(q), dimnames = NULL)

  if (lower.tail == TRUE) {
    f[q >= location] <- 1.0
  }
  else {
    f[q < location] <- 1.0
  }

  if (log.p == TRUE) {
    f <- log(f)
  }

  rm(list = ls()[!(ls() %in% c("f"))])

  return(f)
} ## pdirac

Try the rebmix package in your browser

Any scripts or data that you put into this service are public.

rebmix documentation built on Feb. 9, 2024, 3:01 p.m.