|
auto_bar <- function() {
create_cnt <- read.csv("창업건수.csv", header=T)
drop_cnt <- read.csv("폐업건수.csv", header=T)
x <- rbind(create_cnt$치킨집, drop_cnt$치킨집)
barplot(x, main= "연도별 치킨집 창업, 폐업 건수", col=c("blue", "red"), beside=T, names.arg=drop_cnt$년도,
xlab="연도별", ylab="건수", legend=c("창업", "폐업"), ylim=c(0, 4000), density=70)
}
auto_pie <- function() {
emp <- read.csv("emp3.csv", header=T)
sal_labels <- round(emp$sal/sum(emp$sal) *100, 1)
sal_labels2 <- paste(emp$ename, emp_labels, '%')
pie(emp$sal, main = "Salary Pie Chart", labels = emp_labels2, col=rainbow(12))
}
auto_line <- function() {
create_cnt <- read.csv("창업건수.csv", header=T)
drop_cnt <- read.csv("폐업건수.csv", header=T)
plot(drop_cnt$치킨집, type='o', col='blue', axes=FALSE, ann=FALSE)
lines(create_cnt$치킨집, type='o', pch=22, lty=2, col='red')
axis(1, at=1:10, lab=create_cnt$년도)
axis(2)
legend(8, max(drop_cnt$치킨집), c('폐업', '창업'), col=c("blue", "red"), cex=0.8,
pch=21:22, lty=1:2)
}