Tugas Pertemuan 8 - Visualisasi Data
Tugas Pertemuan 8 - Visualisasi Data
VISUALISASI DATA
Oleh :
MAGISTER STATISTIKA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS HASANUDDIN
MAKASSAR
2021
VISUALISASI DATA
1. Pendahuluan
library(lattice)
demo()
demo(graphics)
##
##
## demo(graphics)
## ---- ~~~~~~~~
##
## > # Copyright (C) 1997-2009 The R Core Team
## >
## > require(datasets)
##
## > require(grDevices); require(graphics)
##
## > ## Here is some code which illustrates some of the differences betwee
n
## > ## R and S graphics capabilities. Note that colors are generally spe
cified
## > ## by a character string name (taken from the X11 rgb.txt file) and t
hat line
## > ## textures are given similarly. The parameter "bg" sets the backgro
und
## > ## parameter for the plot and there is also an "fg" parameter which s
ets
## > ## the foreground color.
## >
## >
## > x <- stats::rnorm(50)
##
## > opar <- par(bg = "white")
##
## > plot(x, ann = FALSE, type = "n")
##
## > abline(h = 0, col = gray(.90))
##
## > lines(x, col = "green4", lty = "dotted")
##
## > points(x, bg = "limegreen", pch = 21)
##
## > title(main = "Simple Use of Color In a Plot",
## + xlab = "Just a Whisper of a Label",
## + col.main = "blue", col.lab = gray(.8),
## + cex.main = 1.2, cex.lab = 1.0, font.main = 4, font.lab = 3)
##
## > ## A little color wheel. This code just plots equally spaced hues
in
## > ## a pie chart. If you have a cheap SVGA monitor (like me) you wil
l
## > ## probably find that numerically equispaced does not mean visually
## > ## equispaced. On my display at home, these colors tend to cluster a
t
## > ## the RGB primaries. On the other hand on the SGI Indy at work the
## > ## effect is near perfect.
## >
## > par(bg = "gray")
##
## > pie(rep(1,24), col = rainbow(24), radius = 0.9)
##
## > title(main = "A Sample Color Wheel", cex.main = 1.4, font.main = 3)
##
## > title(xlab = "(Use this as a test of monitor linearity)",
## + cex.lab = 0.8, font.lab = 3)
##
## > ## We have already confessed to having these. This is just showing o
ff X11
## > ## color names (and the example (from the postscript manual) is prett
y "cute".
## >
## > pie.sales <- c(0.12, 0.3, 0.26, 0.16, 0.04, 0.12)
##
## > names(pie.sales) <- c("Blueberry", "Cherry",
## + "Apple", "Boston Cream", "Other", "Vanilla Cream")
##
## > pie(pie.sales,
## + col = c("purple", "violetred1", "green3", "cornsilk", "cyan",
"white"))
##
## > title(main = "January Pie Sales", cex.main = 1.8, font.main = 1)
##
## > title(xlab="(Don't try this at home kids)", cex.lab=0.8, font.lab=3)
##
## > ## Boxplots: I couldn't resist the capability for filling the "box".
## > ## The use of color seems like a useful addition, it focuses attentio
n
## > ## on the central bulk of the data.
## >
## > par(bg = "cornsilk")
##
## > n <- 10
##
## > g <- gl(n, 100, n*100)
##
## > x <- rnorm(n*100) + sqrt(as.numeric(g))
##
## > boxplot(split(x,g), col = "lavender", notch = TRUE)
##
## > title(main="Notched Boxplots", xlab="Group", font.main=4, font.lab=1)
##
## > ## An example showing how to fill between curves.
## >
## > par(bg = "white")
##
## > n <- 100
##
## > x <- c(0, cumsum(rnorm(n)))
##
## > y <- c(0, cumsum(rnorm(n)))
##
## > xx <- c(0:n, n:0)
##
## > yy <- c(x, rev(y))
##
## > plot(xx, yy, type = "n", xlab = "Time", ylab = "Distance")
##
## > polygon(xx, yy, col = "gray")
##
## > title("Distance Between Brownian Motions")
##
## > ## Colored plot margins, axis labels and titles. You do need to be
## > ## careful with these kinds of effects. It's easy to go completely
## > ## over the top and you can end up with your lunch all over the keybo
ard.
## > ## On the other hand, my market research clients love it.
## >
## > x <- c(0.00, 0.40, 0.86, 0.85, 0.69, 0.48, 0.54, 1.09, 1.11, 1.73, 2.
05, 2.02)
##
## > par(bg = "lightgray")
##
## > plot(x, type = "n", axes = FALSE, ann = FALSE)
##
## > usr <- par("usr")
##
## > rect(usr[1], usr[3], usr[2], usr[4], col="cornsilk", border="black")
##
## > lines(x, col = "blue")
##
## > points(x, pch = 21, bg = "lightcyan", cex = 1.25)
##
## > axis(2, col.axis = "blue", las = 1)
##
## > axis(1, at = 1:12, lab = month.abb, col.axis = "blue")
##
## > box()
##
## > title(main="The Level of Interest in R", font.main=4, col.main="red")
##
## > title(xlab = "1996", col.lab = "red")
##
## > ## A filled histogram, showing how to change the font used for the
## > ## main title without changing the other annotation.
## >
## > par(bg = "cornsilk")
##
## > x <- rnorm(1000)
##
## > hist(x, xlim = range(-4, 4, x), col = "lavender", main ="")
##
## > title(main = "1000 Normal Random Variates", font.main = 3)
##
## > ## A scatterplot matrix
## > ## The good old Iris data (yet again)
## >
## > pairs(iris[1:4], main = "Edgar Anderson's Iris Data", font.main = 4,
pch = 19)
##
## > pairs(iris[1:4], main = "Edgar Anderson's Iris Data", pch = 21,
## + bg = c("red", "green3", "blue")[unclass(iris$Species)])
##
## > ## Contour plotting
## > ## This produces a topographic map of one of Auckland's many volcanic
"peaks".
## >
## > x <- 10*1:nrow(volcano)
##
## > y <- 10*1:ncol(volcano)
##
## > lev <- pretty(range(volcano), 10)
##
## > par(bg = "lightcyan")
##
## > pin <- par("pin")
##
## > xdelta <- diff(range(x))
##
## > ydelta <- diff(range(y))
##
## > xscale <- pin[1]/xdelta
##
## > yscale <- pin[2]/ydelta
##
## > scale <- min(xscale, yscale)
##
## > xadd <- 0.5*(pin[1]/scale - xdelta)
##
## > yadd <- 0.5*(pin[2]/scale - ydelta)
##
## > plot(numeric(0), numeric(0),
## + xlim = range(x)+c(-1,1)*xadd, ylim = range(y)+c(-1,1)*yadd,
## + type = "n", ann = FALSE)
##
## > usr <- par("usr")
##
## > rect(usr[1], usr[3], usr[2], usr[4], col = "green3")
##
## > contour(x, y, volcano, levels = lev, col = "yellow", lty = "solid", a
dd = TRUE)
##
## > box()
##
## > title("A Topographic Map of Maunga Whau", font= 4)
##
## > title(xlab = "Meters North", ylab = "Meters West", font= 3)
##
## > mtext("10 Meter Contour Spacing", side = 3, line = 0.35, outer =
## + FALSE, at = mean(par("usr")[1:2]), cex = 0.7, font = 3)
##
## > ## Conditioning plots
## >
## > par(bg = "cornsilk")
##
## > coplot(lat ~ long | depth, data = quakes, pch = 21, bg = "green3")
##
## > par(opar)
demo(image)
##
##
## demo(image)
## ---- ~~~~~
##
## > # Copyright (C) 1997-2009 The R Core Team
## >
## > require(datasets)
##
## > require(grDevices); require(graphics)
##
## > x <- 10*(1:nrow(volcano)); x.at <- seq(100, 800, by = 100)
##
## > y <- 10*(1:ncol(volcano)); y.at <- seq(100, 600, by = 100)
##
## > # Using Terrain Colors
## >
## > image(x, y, volcano, col = terrain.colors(100), axes = FALSE)
##
## > contour(x, y, volcano, levels = seq(90, 200, by = 5), add = TRUE, co
l = "brown")
##
## > axis(1, at = x.at)
##
## > axis(2, at = y.at)
##
## > box()
##
## > title(main = "Maunga Whau Volcano", sub = "col=terrain.colors(100)",
font.main = 4)
##
## > # Using Heat Colors
## >
## > image(x, y, volcano, col = heat.colors(100), axes = FALSE)
##
## > contour(x, y, volcano, levels = seq(90, 200, by = 5), add = TRUE, co
l = "brown")
##
## > axis(1, at = x.at)
##
## > axis(2, at = y.at)
##
## > box()
##
## > title(main = "Maunga Whau Volcano", sub = "col=heat.colors(100)", fon
t.main = 4)
##
## > # Using Gray Scale
## >
## > image(x, y, volcano, col = gray(100:200/200), axes = FALSE)
##
## > contour(x, y, volcano, levels = seq(90, 200, by = 5), add = TRUE, co
l = "black")
##
## > axis(1, at = x.at)
##
## > axis(2, at = y.at)
##
## > box()
##
## > title(main = "Maunga Whau Volcano \n col = gray(100:200/200)", font.m
ain = 4)
##
## > ## Filled Contours are even nicer sometimes :
## > example(filled.contour)
##
## flld.c> require("grDevices") # for colours
##
## flld.c> filled.contour(volcano, asp = 1) # simple
##
## flld.c> x <- 10*1:nrow(volcano)
##
## flld.c> y <- 10*1:ncol(volcano)
##
## flld.c> filled.contour(x, y, volcano, color = function(n) hcl.colors(n,
"terrain"),
## flld.c+ plot.title = title(main = "The Topography of Maunga Whau",
## flld.c+ xlab = "Meters North", ylab = "Meters West"),
## flld.c+ plot.axes = { axis(1, seq(100, 800, by = 100))
## flld.c+ axis(2, seq(100, 600, by = 100)) },
## flld.c+ key.title = title(main = "Height\n(meters)"),
## flld.c+ key.axes = axis(4, seq(90, 190, by = 10))) # maybe also as
p = 1
##
## flld.c> mtext(paste("filled.contour(.) from", R.version.string),
## flld.c+ side = 1, line = 4, adj = 1, cex = .66)
##
## flld.c> # Annotating a filled contour plot
## flld.c> a <- expand.grid(1:20, 1:20)
##
## flld.c> b <- matrix(a[,1] + a[,2], 20)
##
## flld.c> filled.contour(x = 1:20, y = 1:20, z = b,
## flld.c+ plot.axes = { axis(1); axis(2); points(10, 10) }
)
##
## flld.c> ## Persian Rug Art:
## flld.c> x <- y <- seq(-4*pi, 4*pi, len = 27)
##
## flld.c> r <- sqrt(outer(x^2, y^2, "+"))
##
## flld.c> filled.contour(cos(r^2)*exp(-r/(2*pi)), axes = FALSE)
##
## flld.c> ## rather, the key *should* be labeled:
## flld.c> filled.contour(cos(r^2)*exp(-r/(2*pi)), frame.plot = FALSE,
## flld.c+ plot.axes = {})
demo(lattice)
##
##
## demo(lattice)
## ---- ~~~~~~~
##
## > require(grid)
##
## > old.prompt <- devAskNewPage(TRUE)
##
## > ## store current settings, to be restored later
## > old.settings <- trellis.par.get()
##
## > ## changing settings to new 'theme'
## > trellis.par.set(theme = col.whitebg())
##
## > ## simulated example, histogram and kernel density estimate superpose
d
## > x <- rnorm(500)
##
## > densityplot(~x)
##
## > histogram(x, type = "density",
## + panel = function(x, ...) {
## + panel.histogram(x, ...)
## + panel.densityplot(x, col = "brown", plot.points = FALSE)
## + })
##
## > ## Using a custom panel function to superpose a fitted normal density
## > ## on a Kernel Density Estimate
## >
## > densityplot( ~ height | voice.part, data = singer, layout = c(2, 4),
## + xlab = "Height (inches)",
## + ylab = "Kernel Density\n with Normal Fit",
## + main = list("Estimated Density", cex = 1.4, col =
## + "DarkOliveGreen"), panel = function(x, ...) {
## + panel.densityplot(x, ...)
## + panel.mathdensity(dmath = dnorm,
## + args = list(mean=mean(x),sd=sd(x)))
## + } )
##
## > ## user defined panel functions and fonts
## >
## > states <- data.frame(state.x77,
## + state.name = dimnames(state.x77)[[1]],
## + state.region = factor(state.region))
##
## > xyplot(Murder ~ Population | state.region, data = states,
## + groups = state.name,
## + panel = function(x, y, subscripts, groups)
## + ltext(x = x, y = y, labels = groups[subscripts],
## + cex=.9, fontfamily = "HersheySans", fontface = "italic"),
## + par.strip.text = list(cex = 1.3, font = 4, col = "brown"),
## + xlab = list("Estimated Population, July 1, 1975", font = 2),
## + ylab = list("Murder Rate (per 100,000 population), 1976", font
= 2),
## + main = list("Murder Rates in US states", col = "brown", font =
4))
##
## > ##graphical parameters for xlab etc can also be changed permanently
## > trellis.par.set(list(par.xlab.text = list(font = 2),
## + par.ylab.text = list(font = 2),
## + par.main.text = list(font = 4, col = "brown")))
##
## > ## Same with some multiple line text
## > levels(states$state.region) <-
## + c("Northeast", "South", "North\n Central", "West")
##
## > xyplot(Murder ~ Population | state.region, data = states,
## + groups = as.character(state.name),
## + panel = function(x, y, subscripts, groups)
## + ltext(x = x, y = y, labels = groups[subscripts], srt = -50,
## + col = "blue", cex=.9, fontfamily = "HersheySans"),
## + par.strip.text = list(cex = 1.3, font = 4, col = "brown",
## + lines = 2), xlab = "Estimated Population\nJuly 1, 1975",
## + ylab = "Murder Rate \n(per 100,000 population)\n 1976",
## + main = "Murder Rates in US states")
##
## > ##setting these back to their defaults
## > trellis.par.set(list(par.xlab.text = list(font = 1),
## + par.ylab.text = list(font = 1),
## + par.main.text = list(font = 2, col = "black")))
##
## > ##levelplot
## >
## > levelplot(volcano, colorkey = list(space = "top"),
## + sub = "Maunga Whau volcano", aspect = "iso")
##
## > ## wireframe
## > wireframe(volcano, shade = TRUE,
## + aspect = c(61/87, 0.4),
## + screen = list(z = -120, x = -45),
## + light.source = c(0,0,10), distance = .2,
## + shade.colors.palette = function(irr, ref, height, w = .5)
## + grey(w * irr + (1 - w) * (1 - (1-ref)^.4)))
##
## > ## 3-D surface parametrized on a 2-D grid
## >
## > n <- 50
##
## > tx <- matrix(seq(-pi, pi, length.out = 2*n), 2*n, n)
##
## > ty <- matrix(seq(-pi, pi, length.out = n) / 2, 2*n, n, byrow = T)
##
## > xx <- cos(tx) * cos(ty)
##
## > yy <- sin(tx) * cos(ty)
##
## > zz <- sin(ty)
##
## > zzz <- zz
##
## > zzz[,1:12 * 4] <- NA
##
## > wireframe(zzz ~ xx * yy, shade = TRUE, light.source = c(3,3,3))
##
## > ## Example with panel.superpose.
## >
## > xyplot(Petal.Length~Petal.Width, data = iris, groups=Species,
## + panel = panel.superpose,
## + type = c("p", "smooth"), span=.75,
## + col.line = trellis.par.get("strip.background")$col,
## + col.symbol = trellis.par.get("strip.shingle")$col,
## + key = list(title = "Iris Data", x = .15, y=.85, corner = c(0,1),
## + border = TRUE,
## + points = list(col=trellis.par.get("strip.shingle")$col[1:3],
## + pch = trellis.par.get("superpose.symbol")$pch[1:3],
## + cex = trellis.par.get("superpose.symbol")$cex[1:3]
## + ),
## + text = list(levels(iris$Species))))
##
## > ## non-trivial strip function
## >
## > barchart(variety ~ yield | year * site, barley, origin = 0,
## + layout = c(4, 3),
## + between = list(x = c(0, 0.5, 0)),
## + ## par.settings = list(clip = list(strip = "on")),
## + strip =
## + function(which.given,
## + which.panel,
## + factor.levels,
## + bg = trellis.par.get("strip.background")$col[which.given],
## + ...) {
## + axis.line <- trellis.par.get("axis.line")
## + pushViewport(viewport(clip = trellis.par.get("clip")$strip,
## + name = trellis.vpname("strip")))
## + if (which.given == 1)
## + {
## + grid.rect(x = .26, just = "right",
## + name = trellis.grobname("fill", type="strip"),
## + gp = gpar(fill = bg, col = "transparent"))
## + ltext(factor.levels[which.panel[which.given]],
## + x = .24, y = .5, adj = 1,
## + name.type = "strip")
## + }
## + if (which.given == 2)
## + {
## + grid.rect(x = .26, just = "left",
## + name = trellis.grobname("fill", type="strip"),
## + gp = gpar(fill = bg, col = "transparent"))
## + ltext(factor.levels[which.panel[which.given]],
## + x = .28, y = .5, adj = 0,
## + name.type = "strip")
## + }
## + upViewport()
## + grid.rect(name = trellis.grobname("border", type="strip"),
## + gp =
## + gpar(col = axis.line$col,
## + lty = axis.line$lty,
## + lwd = axis.line$lwd,
## + alpha = axis.line$alpha,
## + fill = "transparent"))
## + }, par.strip.text = list(lines = 0.4))
##
## > trellis.par.set(theme = old.settings, strict = 2)
##
## > devAskNewPage(old.prompt)
str(iris)
plot(Petal.Width ~ Petal.Length)
plot(1, 1, xlim = c(1,7.5), ylim = c(0,5), type = "n")
points(1:7, rep(4.5,7), cex = 1:7, col = 1:7, pch = 0:6)
text(1:7, rep(3.5,7), labels = paste(0:6), cex = 1:7, col = 1:7)
points(1:7, rep(2,7), pch = (0:6)+7)
text((1:7)+0.25, rep(2,7), paste((0:6)+7))
points(1:7, rep(1,7), pch = (0:6)+14)
text((1:7)+0.25, rep(1,7), paste((0:6)+14))
## 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
## 7 4.700 88
## 8 3.600 85
## 9 1.950 51
## 10 4.350 85
## 11 1.833 54
## 12 3.917 84
## 13 4.200 78
## 14 1.750 47
## 15 4.700 83
## 16 2.167 52
## 17 1.750 62
## 18 4.800 84
## 19 1.600 52
## 20 4.250 79
## 21 1.800 51
## 22 1.750 47
## 23 3.450 78
## 24 3.067 69
## 25 4.533 74
## 26 3.600 83
## 27 1.967 55
## 28 4.083 76
## 29 3.850 78
## 30 4.433 79
## 31 4.300 73
## 32 4.467 77
## 33 3.367 66
## 34 4.033 80
## 35 3.833 74
## 36 2.017 52
## 37 1.867 48
## 38 4.833 80
## 39 1.833 59
## 40 4.783 90
## 41 4.350 80
## 42 1.883 58
## 43 4.567 84
## 44 1.750 58
## 45 4.533 73
## 46 3.317 83
## 47 3.833 64
## 48 2.100 53
## 49 4.633 82
## 50 2.000 59
## 51 4.800 75
## 52 4.716 90
## 53 1.833 54
## 54 4.833 80
## 55 1.733 54
## 56 4.883 83
## 57 3.717 71
## 58 1.667 64
## 59 4.567 77
## 60 4.317 81
## 61 2.233 59
## 62 4.500 84
## 63 1.750 48
## 64 4.800 82
## 65 1.817 60
## 66 4.400 92
## 67 4.167 78
## 68 4.700 78
## 69 2.067 65
## 70 4.700 73
## 71 4.033 82
## 72 1.967 56
## 73 4.500 79
## 74 4.000 71
## 75 1.983 62
## 76 5.067 76
## 77 2.017 60
## 78 4.567 78
## 79 3.883 76
## 80 3.600 83
## 81 4.133 75
## 82 4.333 82
## 83 4.100 70
## 84 2.633 65
## 85 4.067 73
## 86 4.933 88
## 87 3.950 76
## 88 4.517 80
## 89 2.167 48
## 90 4.000 86
## 91 2.200 60
## 92 4.333 90
## 93 1.867 50
## 94 4.817 78
## 95 1.833 63
## 96 4.300 72
## 97 4.667 84
## 98 3.750 75
## 99 1.867 51
## 100 4.900 82
## 101 2.483 62
## 102 4.367 88
## 103 2.100 49
## 104 4.500 83
## 105 4.050 81
## 106 1.867 47
## 107 4.700 84
## 108 1.783 52
## 109 4.850 86
## 110 3.683 81
## 111 4.733 75
## 112 2.300 59
## 113 4.900 89
## 114 4.417 79
## 115 1.700 59
## 116 4.633 81
## 117 2.317 50
## 118 4.600 85
## 119 1.817 59
## 120 4.417 87
## 121 2.617 53
## 122 4.067 69
## 123 4.250 77
## 124 1.967 56
## 125 4.600 88
## 126 3.767 81
## 127 1.917 45
## 128 4.500 82
## 129 2.267 55
## 130 4.650 90
## 131 1.867 45
## 132 4.167 83
## 133 2.800 56
## 134 4.333 89
## 135 1.833 46
## 136 4.383 82
## 137 1.883 51
## 138 4.933 86
## 139 2.033 53
## 140 3.733 79
## 141 4.233 81
## 142 2.233 60
## 143 4.533 82
## 144 4.817 77
## 145 4.333 76
## 146 1.983 59
## 147 4.633 80
## 148 2.017 49
## 149 5.100 96
## 150 1.800 53
## 151 5.033 77
## 152 4.000 77
## 153 2.400 65
## 154 4.600 81
## 155 3.567 71
## 156 4.000 70
## 157 4.500 81
## 158 4.083 93
## 159 1.800 53
## 160 3.967 89
## 161 2.200 45
## 162 4.150 86
## 163 2.000 58
## 164 3.833 78
## 165 3.500 66
## 166 4.583 76
## 167 2.367 63
## 168 5.000 88
## 169 1.933 52
## 170 4.617 93
## 171 1.917 49
## 172 2.083 57
## 173 4.583 77
## 174 3.333 68
## 175 4.167 81
## 176 4.333 81
## 177 4.500 73
## 178 2.417 50
## 179 4.000 85
## 180 4.167 74
## 181 1.883 55
## 182 4.583 77
## 183 4.250 83
## 184 3.767 83
## 185 2.033 51
## 186 4.433 78
## 187 4.083 84
## 188 1.833 46
## 189 4.417 83
## 190 2.183 55
## 191 4.800 81
## 192 1.833 57
## 193 4.800 76
## 194 4.100 84
## 195 3.966 77
## 196 4.233 81
## 197 3.500 87
## 198 4.366 77
## 199 2.250 51
## 200 4.667 78
## 201 2.100 60
## 202 4.350 82
## 203 4.133 91
## 204 1.867 53
## 205 4.600 78
## 206 1.783 46
## 207 4.367 77
## 208 3.850 84
## 209 1.933 49
## 210 4.500 83
## 211 2.383 71
## 212 4.700 80
## 213 1.867 49
## 214 3.833 75
## 215 3.417 64
## 216 4.233 76
## 217 2.400 53
## 218 4.800 94
## 219 2.000 55
## 220 4.150 76
## 221 1.867 50
## 222 4.267 82
## 223 1.750 54
## 224 4.483 75
## 225 4.000 78
## 226 4.117 79
## 227 4.083 78
## 228 4.267 78
## 229 3.917 70
## 230 4.550 79
## 231 4.083 70
## 232 2.417 54
## 233 4.183 86
## 234 2.217 50
## 235 4.450 90
## 236 1.883 54
## 237 1.850 54
## 238 4.283 77
## 239 3.950 79
## 240 2.333 64
## 241 4.150 75
## 242 2.350 47
## 243 4.933 86
## 244 2.900 63
## 245 4.583 85
## 246 3.833 82
## 247 2.083 57
## 248 4.367 82
## 249 2.133 67
## 250 4.350 74
## 251 2.200 54
## 252 4.450 83
## 253 3.567 73
## 254 4.500 73
## 255 4.150 88
## 256 3.817 80
## 257 3.917 71
## 258 4.450 83
## 259 2.000 56
## 260 4.283 79
## 261 4.767 78
## 262 4.533 84
## 263 1.850 58
## 264 4.250 83
## 265 1.983 43
## 266 2.250 60
## 267 4.750 75
## 268 4.117 81
## 269 2.150 46
## 270 4.417 90
## 271 1.817 46
## 272 4.467 74
attach(faithful)
summary(eruptions)
fivenum(eruptions)
## Boxplot
boxplot(eruptions)
boxplot(eruptions, main = "Plot dengan Boxplot")
## num [1:87, 1:61] 100 101 102 103 104 105 105 106 107 108 ...