23 2 2 R iris 1 3 plot >plot(iris[,1],iris[,3]) 11 iris[, 3] 1 2 3 4 5 6 7 iris[, 3] 1 2 3 4 5 6 7 119 106 118 123 108 132 101 110 103 104 105 126 131 136 144 109 125 145121 130 135137 129 133 141 138 117 113 149 112 116 140 146 114 102 115 143 150 84 111 122 120 128124 147 134 148 73 78 142 53 7139 64 74 127 57 87 77 51 92 559 107 85 91 6756 86 79 69 88 52 66 98 75 76 9596 97 62 60 90 54 89 100 68 70 83 93 63 72 81 82 65 61 80 5894 99 25 45 24 21 6 19 9 4 3031 12 44 26 2747 48 7 46 13 35 38 10 250 5 840 18 20 22 1 28 29 334911 32 34 16 43 3942 3 41 1737 14 36 15 23 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 iris[, 1] 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 iris[, 1] 11 12 2 12 >plot(iris[,1],iris[,3],type="n") >text(iris[,1],iris[,3]) 1
plot type type= n text plot type= n text(x,y) iris 5 iris 150 50 51 100 101 150 iris.label >iris.label<-rep(c(,, ),rep(50,3)) 2 13 >plot(iris[,1],iris[,3],type="n") >text(iris[,1],iris[,3],iris.label) iris[, 3] 1 2 3 4 5 6 7 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 iris[, 1] 13 2
13 ( ) setosa versicolorvirginica 2 setosa plot 3 3 plot plot(x, y, xlim=range(x), ylim=range(y), type="p", main, xlab, ylab ) x y xlim ylim type main xlab ylab cex "p" "l" "b" "c" "h" "n" () x ( ) y ( ) 3 14 >plot(iris[,1],iris[,3],type="p",xlab="length of epal", ylab="length of Petal",cex=2, col= red ) 4 iris 15 >plot(iris[,1],iris[,3],pch = 21, cex=2,bg = c(2, 3, 4)[unclass(iris$pecies)]) pch = 21 bg = c(2, 3, 4) 3 ( ) [unclass(iris$pecies)] iris pecies Iris 3 50 setosa 2 (red)51100 versicolor 3 (green)101150 virginica 4 (blue) plot cex 3
>par(cex=0.8) cex 0.8 0.8 par 4 14 15 4par par(cex=,pch=, mfrow=, col=,) cex= pch=n ( ) 0 1 16 pch mfrow=c(m,n) m n c(1,1) mfcol=c(m,n) m n c(1,1) bg= col= 1 col=red col=2 () lty= 2 lwd= 1 6 pch pch=1 4
16 pch 2 1 iris iris >pairs(iris[1:4]) pairs(iris[1:4], pch = 21, bg = c("red", "green3", "blue")[unclass(iris$pecies)]) 5
17iris pch = 21 bg = c("red", "green3", "blue") [unclass(iris$pecies)] pecies 3 3 3 18 3 6
183 latticescatterplot3d 3 Package lattice [OK] library(lattice) [Enter] lattice R lattice 3 iris 19 >library(lattice) >cloud(iris[,1]~iris[,2]*iris[,3],col= blue,pch=19,data = iris) 19 iris 3 1 7
cloud cloud(formula,data) data z ~ x * y z x,y ~ 20 >cloud(epal.length ~ Petal.Length * Petal.Width, data = iris,groups = pecies) groups 20 pch=c(16,17,18),col=c(1,2,4) 20 iris 3 2 3 screen = list(z =, x=,y = ) screen = list(z = 0, x=10,y =-15 ) 21 3 graphics persp 2 2 z = y x 5 x 5 5 y 5 >x <- seq(-5, 5, length=50) >y <- x >f <- function(x,y) {r <- (y^2)-(x^2)} >z <- outer(x, y, f) >persp(x, y, z,theta = 60,phi = 25,expand = 0.8,shade=.01,col = "lightblue") 8
persp >data(volcano) >z <- 5 * volcano # 5 >x <- 10 * (1:nrow(z)) # 10 >y <- 10 * (1:ncol(z)) # 10 >par(bg = "skyblue") # >persp(x, y, z, theta = 115, phi = 20, col = "lightgreen", scale = FALE,ltheta = -120, shade = 0.75, border = NA, box = FALE) 23volcano 3 9
graphics contourfilled.contour image lattice >contour(volcano,main="contour(volcano) ") >image(volcano,main="image(volcano) ") contour(volcano) 25image(volcano) >image(volcano,main="image(volcano) n contour(volcano,add=t) n ") >contour(volcano,add=t) 10
26 image contour >filled.contour(volcano, color = terrain.colors) >levelplot(volcano,main="levelplot(volcano) n ") 27 filled.contour 28 levelplot 11