공무원석 연령분ㅅ

csage <- read.csv("D:\\gd\\2016년 2학기\\newdak\\scsage.csv")

library(ggplot2)
library(reshape2)

csage_l <- melt(csage, id = c("regcode","name","agecode","age2","key","age"))

csage_l$year_n <- as.numeric(substr(csage_l$variable, 2, 5))

csage_l$variable[1]
## [1] X2004.년
## 11 Levels: X2004.년 X2005.년 X2006.년 X2007.년 X2008.년 ... X2014.년
ggplot(csage_l[csage_l$name == "소계",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "서울특별시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "부산광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "대구광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "인천광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "광주광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "대전광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")

ggplot(csage_l[csage_l$name == "울산광역시",], aes(x = variable, y = value, fill = age)) + 
    geom_bar(position = "dodge", stat = "identity")