Learn R Programming

agricolae (version 1.0-4)

graph.freq: Frequency table histogram

Description

In many situations it has intervals of class defined with its respective frequencies. By means of this function, the picture of frequency is obtained and it is possible to superpose the normal distribution, polygon of frequency, Ojiva and to construct the table of complete frequency.

Usage

graph.freq(breaks, counts, ...)

Arguments

breaks
Class interval
counts
frequency
...
parameters hist()

Value

  • breaksNumeric
  • countsNumeric

See Also

polygon.freq, table.freq, stat.freq, intervals.freq, sturges.freq, join.freq, ojiva.freq, normal.freq

Examples

Run this code
library(agricolae)
limits <-seq(10,40,5)
frequencies <-c(2,6,8,7,3,4)
#startgraph
h<-graph.freq(limits,frequencies,col="bisque")
polygon.freq(h,col="red")
title( main="Histogram and polygon of frequency",
xlab="Classes", ylab="Frequency")
#endgraph
# Statistics
measures<-stat.freq(h)
print(measures)
# frequency table full
table.freq(h)
#startgraph
# Ojiva
ojiva.freq(h,col="red",type="b",xlab="Variable",ylab="Accumulated relative frequency")
# only frequency polygon
h<-graph.freq(limits,frequencies,border=FALSE,col=NULL)
title( main="Polygon of frequency",
xlab="Variable", ylab="Frecuency")
polygon.freq(h,col="blue")
grid(col="brown")
#endgraph

Run the code above in your browser using DataLab