- Part I. 2020 청소년 통계 보도자료 요약본
- Part II. 인구 분야 시각화
- Part III. 안전,행동 분야 시각화
library(ggplot2)
p<-ggplot(data=df_pop, aes(x=year, y=value, fill=type, label = value)) +
geom_bar(position = "stack", stat = "identity", width=0.5) +
scale_fill_manual(values=c('lightgray', '#2596BE'))+
geom_text(size = 5, position = position_stack(vjust = 0.9)) +
geom_line(aes(x=year,y=ratio*180, group=1),size=2, color = '#2596BE')+
geom_point(aes(x=year,y=ratio*180))+
theme_minimal()
p + labs(title="청소년 인구 및 구성비", x="년도", y="인구수(만명)")
2019년 통계(left), 2020년 통계(right)
2019년 통계(left), 2020년 통계(right)
library(ggplot2)
p <- ggplot(df_safety, aes(x = year, y = ratio, group=type)) +
geom_line(size=2, aes(color = type)) +
geom_text(aes(label=ratio),vjust = -1) +
scale_color_manual(values = c("#7CAE00", "steelblue")) +
theme_minimal()
p + scale_y_continuous(expand = c(0, 0), limits = c(0, 25)) +
labs(title="청소년 음주율과 흡연율", y = "비율(%)", x="년도") +
theme(axis.text = element_text(size=12), axis.title = element_text(size=15))