Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Histogram

A histogram allows the basic distribution of the data to be viewed. Here we plot the histogram for magnesium and alcohol content of various wines, and we might compare it with the previous stem-and-leaf plot which summarises the same data. The shape is basically the same, although in detail they go up and down at different points!

Image rplot-wine-hist



attach(wine)
par(mfrow=c(1, 2))
hist(Magnesium)
hist(Alcohol)

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

Also, from Rattle, we have:

pdf("graphics/rattle-audit-explore-dist-hist-income.pdf")
library(rattle)
library(vcd)
data(audit)
ds <- audit$Income
hs <- hist(ds, main="", xlab="",
           col=rainbow_hcl(25, start = 270, end = 150),
           breaks="scott", border=FALSE)
dens <- density(ds)

http://rattle.togaware.com/code/rattle-audit-explore-dist-hist-income.R



Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010