R/zipf.fnc.R

Defines functions `zipf.fnc`

`zipf.fnc` <-
function(text, plot = FALSE) {
  spectrum = spectrum.fnc(text)
  spectrum = spectrum[nrow(spectrum):1,]
  spectrum$rank = cumsum(spectrum$freqOfFreq)
  if (plot) 
    plot(log(spectrum$rank), log(spectrum$frequency), 
      xlab = "log rank", ylab = "log frequency", 
      type = "S")
  return(spectrum)
}

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.