R/Vm_tfl.R

Vm.tfl <- function (obj, m, ...)
{
  if (! inherits(obj, "tfl")) stop("first argument must be object of class 'tfl'")
  m <- as.integer(m)
  if (length(m) != 1 || any(m < 0) ) stop("second argument must be single non-negative integer")

  if (attr(obj, "incomplete") && (m < attr(obj, "f.min") || m > attr(obj, "f.max"))) {
    NA
  }
  else {
    sum(obj$f == m)
  }
}

Try the zipfR package in your browser

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

zipfR documentation built on Jan. 8, 2021, 2:37 a.m.