library(agricolae)
x<-seq(10,40,5)
y<-c(2,6,8,7,3,4)
#startgraph
h<-graph.freq(x,y,col="bisque")
polygon.freq(h,col="red")
title( main="Histogram and polygon of frequency",
xlab="Variable X", 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")
# only frequency polygon
h<-graph.freq(x,y,border=FALSE,col=NULL)
title( main="Polygon of frequency",
xlab="Variable X", ylab="Frecuency")
polygon.freq(h,col="blue")
grid(col="brown")
#endgraph
Run the code above in your browser using DataLab