R/text2spc.fnc.R

Defines functions `text2spc.fnc`

`text2spc.fnc` <-
function(text) {
  if (!requireNamespace("zipfR", quietly = TRUE)) {
    stop("please install the zipfR library first")
  } else {
    tab = table(table(text))
    return(zipfR::spc(m = as.numeric(names(tab)), Vm = as.numeric(tab)))
  }
}

Try the languageR package in your browser

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

languageR documentation built on May 2, 2019, 10:02 a.m.