R Visualization - Points() 함수
> x x [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5> y y [1] 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1 5 4 3 2 1> pchs plot(1:5, type = "n", xlim = c(0,7.5), ylim=c(0.5,5.5), main = "point by 'pch'")> points(x,y, pch = 1:25, cex=1.5)> text(x-0.4, y, labels = as.character(1:25), cex=1.2)> points(rep(6,5), 5:1, pch = 65:69, cex = 1.5)> text(rep(6,5) -0.4, y, labels = as.character(65:69), cex..
R Visualization - plot() 함수
> # X 좌표를 위한 벡터> x1 # Y 좌표를 위한 벡터> y1 # 벡터 생성> z1 # 행렬 생성> (mat1 # 그래픽 윈도우의 화면 분할(2행3열)> op par(mfrow = c(2,3))> # 일변량 그래프> plot(y1, main="using index")> # 이변량 그래프> plot(x=x1, y=y1, main="x^2")> # 이변량 그래프(행렬)> plot(mat1, main="using matrix")> plot(x1, y1, type="l", main="line")> plot(x1, y1, type="c", main="line")> plot(x1, y1, type="h", main="high density")> plot(x1, y1, type="n", main="no plot..
벡터] 외적과 내적 계산
R에서 일반 행렬의 곱은 다음과 같은 방법으로 구할 수 있다. 1. 내적(%*%) > a a [1] 1 2 3 4 5> a %*% a [,1] [1,] 55 2. 외적(%o%)> a %o% a [,1] [,2] [,3] [,4] [,5] [1,] 1 2 3 4 5 [2,] 2 4 6 8 10 [3,] 3 6 9 12 15 [4,] 4 8 12 16 20 [5,] 5 10 15 20 25 외적에서의 가운데 문자는 알파벳 '오(O)' 이다