Main page: https://www.rdocumentation.org/packages/datasets/versions/3.6.2/topics/faithful
head(faithful)
## eruptions waiting
## 1 3.600 79
## 2 1.800 54
## 3 3.333 74
## 4 2.283 62
## 5 4.533 85
## 6 2.883 55
require(stats); require(graphics)
f.tit <- "faithful data: Eruptions of Old Faithful"
ne60 <- round(e60 <- 60 * faithful$eruptions)
all.equal(e60, ne60) # relative diff. ~ 1/10000
## [1] "Mean relative difference: 9.515332e-05"
table(zapsmall(abs(e60 - ne60))) # 0, 0.02 or 0.04
##
## 0 0.02 0.04
## 106 163 3
faithful$better.eruptions <- ne60 / 60
te <- table(ne60)
te[te >= 4] # (too) many multiples of 5 !
## ne60
## 105 108 110 112 113 120 216 230 240 245 249 250 255 260 261 262 265 270 272 275
## 6 4 7 8 4 4 4 5 6 5 4 4 4 5 4 4 4 8 5 4
## 276 282 288
## 4 6 6
plot(names(te), te, type = "h", main = f.tit, xlab = "Eruption time (sec)")
plot(faithful[, -3], main = f.tit,
xlab = "Eruption time (min)",
ylab = "Waiting time to next eruption (min)")
lines(lowess(faithful$eruptions, faithful$waiting, f = 2/3, iter = 3),
col = "red")