https://github.com/cran/agricolae
Tip revision: 7c490a8df392d6fdd09ced5277eeb989b8a54144 authored by Felipe de Mendiburu on 12 April 2007, 00:00:00 UTC
version 1.0-3
version 1.0-3
Tip revision: 7c490a8
sturges.freq.R
"sturges.freq" <-
function(x){
maximo<-max(x)
minimo<-min(x)
amplitud<-maximo-minimo
n<-length(x)
k<-ceiling(1+3.32*log10(n))
d<-decimals(x)
tic<-round(amplitud/k,d+1)
clases<-seq(minimo,maximo,tic)
nc<-length(clases)
if(maximo > clases[nc]) clases<-c(clases,clases[nc]+tic)
k<-length(clases)-1
lista<-list(maximum=maximo,minimum=minimo,amplitude=amplitud,K.classes=k,size.interval=tic,classes=clases)
return(lista)
}