R/vec2tfl.R

vec2tfl <- function (x)
{
  freqs <- table(as.factor(x))
  idx <- order(freqs, decreasing=TRUE)
  result <- tfl(f=as.vector(freqs)[idx], type=names(freqs)[idx])
  if (N(result) != length(x))
    stop("internal error (inconsistency between sample size and type frequency list")
  result
}

Try the zipfR package in your browser

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

zipfR documentation built on Nov. 13, 2020, 3:01 a.m.