Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Practical Histogram

Suppose we are interested in the distribution of the Alcohol content in the wine dataset. The numeric values are grouped by hist into intervals and the bars represent the frequency of occurrence of each interval as a height. A rug is added to the plot, just above the x-axis, to illustrate the density of values.


[width=0.6]rplot-hist-colour


pdf('graphics/rplot-hist-colour.pdf')
load("wine.Rdata")
attach(wine)
hist(Alcohol, col='lightgreen')
rug(Alcohol)
dev.off()

http://rattle.togaware.com/code/rplot-hist-colour.R



Copyright © 2004-2006 [email protected]
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.