R/baselineabif.R

Defines functions baselineabif

Documented in baselineabif

baselineabif <- function(rfu, maxrfu = 1000){
  #
  # Check argument:
  #
  if(!is.numeric(rfu)) stop("numerical vector expected for rfu")
  #
  # Do not consider data above threshold maxrfu:
  #
  rfu[rfu >= maxrfu] <- NA
  #
  # Compute a kernel density estimate of data:
  #
  dst <- density(rfu, na.rm = TRUE)
  #
  # Choose as baseline the most common value:
  #
  baseline <- dst$x[which.max(dst$y)]
  return(baseline)
}

Try the seqinr package in your browser

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

seqinr documentation built on March 31, 2023, 3:05 p.m.