Tôi sẽ sử dụng Dataset: https://www.kaggle.com/kaggle/kaggle-survey-2017 này để phân tích và tìm ra những skills nào cần có khi làm việc trong lĩnh vực data science.
rm(list = ls())
library(pander)
library(tidyverse)
## -- Attaching packages ------------------------------------- tidyverse 1.2.1 --
## v ggplot2 3.2.0 v purrr 0.3.2
## v tibble 2.1.3 v dplyr 0.8.1
## v tidyr 0.8.3 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.4.0
## -- Conflicts ---------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(ggthemes)
df_survey <- read.csv("E:\\R\\Data\\kaggle-survey-2017\\multipleChoiceResponses.csv", stringsAsFactors = FALSE)
Tôi chọn lựa những biến số về skills cần thiết, có thì tốt và không cần thiết theo quan điểm của những người được phỏng vấn (16.734 người).
df_survey %>%
select(contains("JobSkill"), -contains("JobSkillImportanceOther")) %>%
gather(a,b) %>%
mutate(a = str_replace_all(a, "JobSkillImportance", "")) %>%
table() %>%
as.data.frame() %>%
spread(b, Freq) %>%
select(-V1) -> df_skill
names(df_skill)[1]<-"Skills"
names(df_skill)[3]<-"Nice.To.Have"
head(df_skill, 11)
## Skills Necessary Nice.To.Have Unnecessary
## 1 BigData 1503 2271 182
## 2 Degree 1094 2338 477
## 3 EnterpriseTools 535 2087 1072
## 4 KaggleRanking 460 2621 789
## 5 MOOC 411 2326 1095
## 6 Python 2604 1319 108
## 7 R 1636 2027 281
## 8 SQL 1690 1914 288
## 9 Stats 2035 1812 113
## 10 Visualizations 1761 1898 208
str(df_skill)
## 'data.frame': 10 obs. of 4 variables:
## $ Skills : Factor w/ 10 levels "BigData","Degree",..: 1 2 3 4 5 6 7 8 9 10
## $ Necessary : int 1503 1094 535 460 411 2604 1636 1690 2035 1761
## $ Nice.To.Have: int 2271 2338 2087 2621 2326 1319 2027 1914 1812 1898
## $ Unnecessary : int 182 477 1072 789 1095 108 281 288 113 208
library(hrbrthemes)
## NOTE: Either Arial Narrow or Roboto Condensed fonts are required to use these themes.
## Please use hrbrthemes::import_roboto_condensed() to install Roboto Condensed and
## if Arial Narrow is not on your system, please see http://bit.ly/arialnarrow
my_colors <- c("#835C3B")
my_font <- "Arial"
df_skill %>%
arrange(desc(Necessary)) %>%
ggplot(aes(reorder(Skills, Necessary),Necessary)) +
geom_col(fill = my_colors, color = my_colors, width = 0.8) +
coord_flip() +
geom_text(data = df_skill , aes(label = Necessary),
hjust = 1.1, color = "yellow", size = 5.5, family = my_font) +
theme_ft_rc() +
theme(plot.background = element_rect(fill = "grey20"),
panel.background = element_rect(fill = "grey20",
colour = "grey20")) +
theme(panel.grid = element_blank()) +
theme(axis.text.x = element_blank()) +
theme(axis.text.y = element_text(color = "yellow", size = 16, family = my_font)) +
theme(plot.title = element_text(color = "yellow", size = 28)) +
scale_y_discrete(expand = c(0.01, 0)) +
theme(plot.margin = unit(c(1.2, 1.2, 1.2, 1.2), "cm")) +
labs(x = NULL, y = NULL,
title = "Necessary Skills",
caption = "Data Source: Kaggle Data Science Survey")
df_skill %>%
arrange(desc(Nice.To.Have)) %>%
ggplot(aes(reorder(Skills, Nice.To.Have),Nice.To.Have)) +
geom_col(fill = my_colors, color = my_colors, width = 0.8) +
coord_flip() +
geom_text(data = df_skill , aes(label = Nice.To.Have),
hjust = 1.1, color = "green", size = 5.5, family = my_font) +
theme_ft_rc() +
theme(plot.background = element_rect(fill = "grey20"),
panel.background = element_rect(fill = "grey20",
colour = "grey20")) +
theme(panel.grid = element_blank()) +
theme(axis.text.x = element_blank()) +
theme(axis.text.y = element_text(color = "lightgreen", size = 16, family = my_font)) +
theme(plot.title = element_text(color = "lightgreen",size = 28)) +
scale_y_discrete(expand = c(0.01, 0)) +
theme(plot.margin = unit(c(1, 1, 1, 1), "cm")) +
labs(x = NULL, y = NULL,
title = "Nice To Have Skills",
caption = "Data Source: Kaggle Data Science Survey")
df_skill %>%
arrange(desc(Unnecessary)) %>%
ggplot(aes(reorder(Skills, Unnecessary),Unnecessary)) +
geom_col(fill = my_colors, color = my_colors, width = 0.8) +
coord_flip() +
geom_text(data = df_skill , aes(label = Unnecessary),
hjust = 1.1, color = "pink", size = 5.5, family = my_font) +
theme_ft_rc() +
theme(plot.background = element_rect(fill = "grey20"),
panel.background = element_rect(fill = "grey20",
colour = "grey20")) +
theme(panel.grid = element_blank()) +
theme(axis.text.x = element_blank()) +
theme(axis.text.y = element_text(color = "pink", size = 16, family = my_font)) +
theme(plot.title = element_text(color = "pink", size = 28)) +
scale_y_discrete(expand = c(0.01, 0)) +
theme(plot.margin = unit(c(1.2, 1.2, 1.2, 1.2), "cm")) +
labs(x = NULL, y = NULL,
title = "Unnecessary Skills",
caption = "Data Source: Kaggle Data Science Survey")
Python, kiến thức thống kê, đồ họa, SQL, R là những kĩ năng cần thiết nhất mà những người làm việc trong lĩnh vực data science cần có hiện nay.