up through quantitative data histograms

This commit is contained in:
Dan Buch 2011-07-11 06:12:54 -04:00
parent 9cb9c68c87
commit 6e61c43762
2 changed files with 50 additions and 0 deletions

Binary file not shown.

View File

@ -79,3 +79,53 @@ pie(tapply(painters$Composition, painters$School, mean))
barchart(tapply(painters$Composition, painters$School, mean)) barchart(tapply(painters$Composition, painters$School, mean))
barplot(tapply(painters$Composition, painters$School, mean)) barplot(tapply(painters$Composition, painters$School, mean))
q() q()
head(faithful)
duration = faithful$eruptions
range(duration)
breaks = seq(1.5, 5.5, by=0.5)
breaks
duration.cut = cut(duration, breaks, right=FALSE)
duration.freq = table(duration.cut)
duration.freq
cbind(duration.freq)
barplot(duration.freq)
nrow(faithful)
faithful$eruptions / nrow(faithful)
help(hist)
hist(faithful$eruptions)
faithful)
head(faithful)
hist(faithful$waiting)
hist(faithful)
help(barplot)
VADeaths
help(demo)
demo()
demo("graphics")
hist(faithful$waiting)
interval = faithful$waiting
interval
range(interval)
breaks = seq(43, 96, by=1)
breaks
interval.cut = cut(interval, breaks, right=FALSE)
interval.freq = table(interval.cut)
barplot(interval.freq)
breaks = seq(43, 96, by=5)
breaks
interval.cut = cut(interval, breaks, right=FALSE)
interval.freq = table(interval.cut)
barplot(interval.freq)
help(points)
points(interval.freq)
barplot(interval.freq)
hist(faithful$eruptions, right=FALSE)
duration = faithful$eruptions
hist(duration, right=FALSE)
colors = c("red", "yellow", "green", "violet", "orange", "blue", "pink", "cyan")
hist(duration, right=FALSE, col=colors, main="Old Faithful Eruptions", xlab="Duration minutes")
waiting_period = faithful$waiting
waiting_period = faithful$waiting
hist(waiting_period, right=FALSE, col=colors, main="Old Faithful Eruptions", xlab="Interval")
hist(waiting_period, right=FALSE, col=colors, main="Old Faithful Eruptions", xlab="Interval in minutes")
q()