728x90
반응형

R에서는 화면을 여러 개로 가상 분할한 후, 각각의 분할된 화면에 여러 개의 그래프를 출력하는 기능을 제공한다.

더보기
# 한 화면에 그래프 여러 개 출력하기
par(mfrow=c(1,3)) # 1*3개의 가상화면 분할
barplot(table(mtcars$carb),
        main = "Barplot of Carburetors",
        xlab = "$#of carburetors",
        ylab = "frequency",
        col = "blue")
barplot(table(mtcars$cyl),
        main = "Barplot of Cylender",
        xlab = "#of cylender",
        ylab = "frequency",
        col ="red")
barplot(table(mtcars$gear),
        main = "Barplot of Cylender",
        xlab = "#of gears",
        ylab = "frequency",
        col ="green",
        )
        
par(mfrow=c(1,1)) # 가상화면 분할 해제

[그림1] 한 화면에 그래프 여러 개 출력

 

 

출처 : 모두를 위한 R 데이터 분석 입문 한빛아카데미

728x90
반응형
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기