Data

library(knitr)
load("./hh_econ_10th.RData")
rownames(hh.econ.10th.11) <- c("Market Income", "Expenditure", "Disposable Income")
colnames(hh.econ.10th.11) <- c("1st", "2nd", "3rd", paste(4:10, "th", sep = ""))
kable(format(hh.econ.10th.11/1000, digits = 1, nsmall = 1, justify = "right", big.mark = ","), align = "r")
1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th
Market Income 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
Expenditure 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
Disposable Income 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
rownames(hh.econ.10th.11.2) <- c("Market Income", "Disposable Income", "Expenditure")
colnames(hh.econ.10th.11.2) <- c("1st", "2nd", "3rd", paste(4:10, "th", sep = ""))
kable(format(hh.econ.10th.11.2/1000, digits = 1, nsmall = 1, justify = "right", big.mark = ","), align = "r")
1st 2nd 3rd 4th 5th 6th 7th 8th 9th 10th
Market Income 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
Disposable Income 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
Expenditure 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)
title.kr <- "2011년 가계수지"
xlab.kr <- "소득 10분위"
ylab.kr <- "금액(단위:백만원)"
title(main = title.kr, xlab = xlab.kr, ylab = ylab.kr)

Legends, 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.en <- "Households Income and Expenditure (2011)"
xlab.en <- "Income Tenths"
ylab.en <- "Amount in Million Won"
title(main = title.en, xlab = xlab.en, ylab = ylab.en, 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)

Save

save.image("./hh_econ_10th_en.RData")