up to cum freq graph

This commit is contained in:
Dan Buch 2011-07-12 21:32:36 -04:00
parent 6e61c43762
commit ad72881793
2 changed files with 41 additions and 0 deletions

Binary file not shown.

View File

@ -129,3 +129,44 @@ 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")
hist(waiting_period, right=FALSE, col=colors, main="Old Faithful Eruptions", xlab="Interval in minutes") hist(waiting_period, right=FALSE, col=colors, main="Old Faithful Eruptions", xlab="Interval in minutes")
q() q()
duration = faithful$eruptions
breaks = seq(1.5, 5.5, by=0.5)
duration.cut = cut(duration, breaks, right=FALSE)
duration.freq = table(duration.cut)
duration.relfreq = duration.freq / nrow(faithful)
duration.relfreq
pie(duration.relfreq)
hist(duration.relfreq)
hist(duration.relfreq)
duration.freq
duration = faithful$eruptions
breaks = seq(1.5, 5.5, by=0.5)
breaks
typeof(breaks)
duration.cut = cut(duration, breaks, right=FALSE)
duration.freq = table(duration.cut)
duration.cumfreq = cumsum(duration.freq)
duration.cumfreq
hist(cbind(duration.cumfreq))
interval = faithful$waiting
help(function)
help("function")
help("function")
calc_cumfreq <- function(records)
breaks = seq(1.5, 5.5, by=0.5)
records.cut = cut(duration, breaks, right=FALSE)
records.freq = table(duration.cut)
records.cumfreq = cumsum(records.freq)
return(records)
calc_cumfreq <- function(records)
breaks = seq(1.5, 5.5, by=0.5)
records.cut = cut(records, breaks, right=FALSE)
help("function")
duration.cumfreq
interval = faithful$eruptions
breaks
breaks.cut = cut(interval, breaks, right=FALSE)
interval.freq = table(interval.cut)
interval.cumfreq = cumsum(interval.freq)
hist(interval.cumfreq)
q()