Data

library(knitr)
load("./hh_econ_10th.RData")
kable(format(hh.econ.10th.11/1000, digits = 1, nsmall = 1, justify = "right", big.mark = ","), align = "r")
1분위 2분위 3분위 4분위 5분위 6분위 7분위 8분위 9분위 10분위
소득 831.4 1,678.2 2,289.5 2,811.3 3,268.6 3,742.0 4,268.8 4,913.1 5,914.1 8,692.1
소비지출 1,000.3 1,437.0 1,763.9 2,074.7 2,302.2 2,399.0 2,706.6 2,977.3 3,251.7 4,011.5
처분가능소득 646.8 1,389.7 1,898.0 2,338.3 2,708.0 3,098.2 3,476.6 3,988.7 4,713.3 6,930.2
kable(format(hh.econ.10th.11.2/1000, digits = 1, nsmall = 1, justify = "right", big.mark = ","), align = "r")
1분위 2분위 3분위 4분위 5분위 6분위 7분위 8분위 9분위 10분위
소득 831.4 1,678.2 2,289.5 2,811.3 3,268.6 3,742.0 4,268.8 4,913.1 5,914.1 8,692.1
처분가능소득 646.8 1,389.7 1,898.0 2,338.3 2,708.0 3,098.2 3,476.6 3,988.7 4,713.3 6,930.2
소비지출 1,000.3 1,437.0 1,763.9 2,074.7 2,302.2 2,399.0 2,706.6 2,977.3 3,251.7 4,011.5

Bar Plots

par(family = "HCR Dotum LVT")
barplot(hh.econ.10th.11)

par(family = "HCR Dotum LVT")
barplot(hh.econ.10th.11, beside = TRUE)

par(family = "HCR Dotum LVT")
barplot(hh.econ.10th.11.2, beside = TRUE)

Axes and Titles

par(family = "HCR Dotum LVT")
barplot(hh.econ.10th.11.2, beside = TRUE, yaxt = "n", col = gray(c(1/6, 1/2, 5/6)))
axis(side = 2, at = seq(0, 10000000, by = 1000000), labels = 0:10, las = 1)
legend("topleft", inset = 0.1, legend = rownames(hh.econ.10th.11.2), fill = gray(c(1/6, 1/2, 5/6)))
title(main = "2011년 가계수지", xlab = "소득 10분위", ylab = "금액(단위, 백만원)")

Lines, colors

par(family = "HCR Dotum LVT")
# b <- barplot(hh.econ.10th.11.2, beside = TRUE, yaxt = "n", col = gray(c(1/6, 1/2, 5/6)))
b <- barplot(hh.econ.10th.11.2, beside = TRUE, yaxt = "n", col = c("blue", "cyan", "red"))
axis(side = 2, at = seq(0, 10000000, by = 1000000), labels = 0:10, las = 1)
# legend("topleft", inset = 0.1, legend = rownames(hh.econ.10th.11), fill = gray(c(1/6, 1/2, 5/6)))
legend("topleft", inset = 0.1, legend = rownames(hh.econ.10th.11.2), fill = c("blue", "cyan", "red"))
title(main = "2011년 가계수지", xlab = "소득 10분위", ylab = "금액(단위, 백만원)", cex.main = 2.0)
# lines(x = seq(2.5, 38.5, length.out=10), y = hh.econ.10th.11[2, ], lwd=5, col=gray(1/2))
lines(x = b[2, ], y = hh.econ.10th.11.2[2, ], type = "b", pch = 24, bg = "white", col = "black", lwd = 4)
# lines(x = b[2, ], y = hh.econ.10th.11[2, ], lwd = 8, col = gray(1/2))
lines(x = b[3, ], y = hh.econ.10th.11.2[3, ], type = "b", pch = 25, bg = "white", col = "black", lwd = 4)

dev.copy(png, file = "../pics/no_trickle_down_effect.png", width = 960, height = 540)
## quartz_off_screen 
##                 3