install.packages("ggplot2")
library(ggplot2)
install.packages("dplyr")
library(dplyr)
install.packages("readxl")
library(readxl)
test<- read.csv("c:/gimalproject/부산지하철_와이파이.csv")
test

#전체 호선 통신사 3사 나누기
test %>% filter(회사명=="SKT")
dim(test %>% filter(회사명=="SKT")) #109개
dim(test %>% filter(회사명=="KT"))#103개
dim(test %>% filter(회사명=="LGU+"))#100개
tong<-data.frame(tongsinsa=c("SKT","KT","LGU+"),
                 sum=c(109,103,100))
tong
ggplot(data=tong,aes(x=tongsinsa,y=sum))+geom_col()


#2호선 통신사 3사 비율
test %>% filter(회사명=="SKT" & 호선 =="1호선") 
dim(test %>% filter(회사명=="SKT" & 호선 =="1호선")) #40개
dim(test %>% filter(회사명=="KT" & 호선 =="1호선"))#37개
dim(test %>% filter(회사명=="LGU+" & 호선 =="1호선"))#37개
onehosun<-data.frame(tongsinsa=c("SKT","KT","LGU+"),
                     sum=c(40,41,42))
onehosun

ggplot(data=onehosun,aes(x=tongsinsa, y= sum))+geom_col()
#호선별로 통신사 3사 분류
dim(test %>% filter(회사명=="SKT" & 호선 =="2호선"))#40개
dim(test %>% filter(회사명=="KT" & 호선 =="2호선"))#41개
dim(test %>% filter(회사명=="LGU+" & 호선 =="2호선"))#42개
dim(test %>% filter(회사명=="SKT" & 호선 =="3호선"))#17개
dim(test %>% filter(회사명=="KT" & 호선 =="3호선"))#14개
dim(test %>% filter(회사명=="LGU+" & 호선 =="3호선"))#12개
dim(test %>% filter(회사명=="SKT" & 호선 =="4호선"))#12개
dim(test %>% filter(회사명=="KT" & 호선 =="4호선"))#11개
dim(test %>% filter(회사명=="LGU+" & 호선 =="4호선"))#9개
hosun<-data.frame(tongsinsa=c("SKT","KT","LGU+","SKT","KT","LGU+","SKT","KT","LGU+","SKT","KT","LGU+"),
                  hosun=c("1호선","1호선","1호선","2호선","2호선","2호선","3호선","3호선","3호선","4호선","4호선","4호선"),
                  gatsu=c(40,37,37,40,41,42,17,14,12,12,11,9))
hosun
ggplot(data=hosun, aes(x=tongsinsa, y=gatsu, fill=hosun)) +geom_col() +scale_x_discrete(limits=c("SKT","KT","LGU+"))


mung<-data.frame(surang=c(12,16,6,8,9,10,5,6,7,7,6,5,4,6,6,7,7,8,7,6,6,6,6,5,13,6,6,6,6,5,6,6,6,6,6,6,7,6,6,3),
                  muung=c("다대포해수욕장","다대포항","낫개","신장림","장림","동매","신평","하단","당리","사하","괴정","대티","서대신","동대신","토성","자갈치","남포","중앙","부산역","초량","부산진","좌천","범일","범내골","서면","부전","양정","시청","연산","교대","동래","명륜","온천장","부산대","장전","구서","두실","남산","범어사","노포"
))
ggplot(data=mung, aes(x=muung, y=surang)) +geom_col()

