# 先確認檔案格式再讀取資料
fL <- paste0("http://", IDPW, "140.116.183.121/~sheu/dataM/Data/ncku_roster.csv")
headers <- read.csv(fL, header = F, nrows = 1, as.is = T)
dta <- read.csv(fL, skip = 2, header = F)
colnames(dta) <- headers
#將資料新增學科排序的變項,進行繪圖
new_dta <- dta %>%
separate(2, into = c("major", "info"), sep = " ") %>%
mutate(major = as.factor(major))
## Warning: Expected 2 pieces. Additional pieces discarded in 15 rows [1, 2,
## 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].
## Warning: package 'bindrcpp' was built under R version 3.4.3
#
ggplot(new_dta, aes(major, ..count..))+
geom_bar()+
labs(x = "學生系所", y = "Count", subtitle = "資料管理修課學生系所來源")
