#맥에서 한글 깨짐 해결
par(family = "AppleGothic")

#단순 파이차트
x <- c(9, 15, 20, 6)
label <- c("영업1팀", "영업2팀", "영업3팀", "영업4팀")
pie(x, labels=label, main="부서별 영업 실적")

#바 차트
barplot(x,
        names.arg=label,
        main="부서별 영업 실적",
        col=rainbow(length(x)),
        xlab="부서",
        ylab="영업 실적(억 원)")

#애니메이션으로 카운트 다운
library(animation)
ani.options(interval=1)
plot.new()

for (i in 10:0) {
  #left, bottom, right, top, col:컬러
  rect(0, 0, 1, 1, col="yellow")
  #x, y, label, cex=글자크기, col:컬러
  text(0.5, 0.5, i, cex=5, col=rgb(.2,.2,.2,.7))  
  ani.pause()
}