본문 바로가기

Programming/R programming

R Visualization - Points() 함수


> x <- rep(1:5, rep(5,5))

> 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 <- rep(5:1, 5)

> 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 <- c("&", "z", "Z", "1", "가")

> 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 = 1.2)

> points(rep(7,5), 5:1, pch=pchs, cex = 1.5)

> text(rep(7.5) -0.4, y, labels = paste("'", pchs, "'", sep =""), cex = 1.2)




'Programming > R programming' 카테고리의 다른 글

조건 체크  (0) 2016.01.04
난수 생성 함수  (0) 2016.01.04
R Visualization - plot() 함수  (0) 2015.11.19
벡터] 외적과 내적 계산  (0) 2015.07.06
R에서 누락된 데이터 처리하기  (0) 2015.06.30