sturges.freq: Class intervals for a histogram, the rule of Sturges

sturges.freqR Documentation

Class intervals for a histogram, the rule of Sturges

Description

if k=0 then classes: k = 1 + log(n,2). if k > 0, fixed nclass.

Usage

sturges.freq(x,k=0)

Arguments

x

vector

k

constant

Value

Statistics of sturges for a histogram.

Author(s)

Felipe de mendiburu

References

Reza A. Hoshmand. 1988. Statistical Methods for Agricultural Sciences, Timber Press, Incorporated, pag 18-21.

See Also

polygon.freq, table.freq, stat.freq, inter.freq, graph.freq, join.freq, ogive.freq, normal.freq

Examples

library(agricolae)
data(natives)
classes<-with(natives,sturges.freq(size))
# information of the classes
breaks <- classes$breaks
breaks
#startgraph
# Histogram with the established classes
h<-with(natives,graph.freq(size,breaks,frequency=1, col="yellow",axes=FALSE,
    xlim=c(0,0.12),main="",xlab="",ylab=""))
axis(1,breaks,las=2)
axis(2,seq(0,400,50),las=2)
title(main="Histogram of frequency\nSize of the tubercule of the Oca",
xlab="Size of the oca", ylab="Frequency")
#endgraph

agricolae documentation built on Oct. 23, 2023, 1:06 a.m.