Job_Category | 1 | 2 | 3 | 4 | Grand_Total |
---|---|---|---|---|---|
Healthcare Representative | 17 | 20 | 54 | 40 | 131 |
Human Resources | 4 | 13 | 19 | 16 | 52 |
Laboratory Technician | 53 | 69 | 74 | 63 | 259 |
Manager | 11 | 39 | 27 | 25 | 102 |
Manufacturing Director | 28 | 35 | 49 | 33 | 145 |
Research Director | 12 | 20 | 31 | 17 | 80 |
Research Scientist | 46 | 63 | 90 | 93 | 292 |
Sales Executive | 85 | 102 | 66 | 73 | 326 |
Sales Representative | 24 | 13 | 21 | 25 | 83 |
Grand Total | 280 | 374 | 431 | 385 | 1,470 |
Job_Category | 1 | 2 | 3 | 4 | Grand_Total |
---|---|---|---|---|---|
Healthcare Representative | 19 | 23 | 43 | 46 | 131 |
Human Resources | 8 | 11 | 19 | 14 | 52 |
Laboratory Technician | 50 | 47 | 70 | 92 | 259 |
Manager | 19 | 16 | 31 | 36 | 102 |
Manufacturing Director | 21 | 22 | 43 | 59 | 145 |
Research Director | 22 | 17 | 19 | 22 | 80 |
Research Scientist | 54 | 50 | 76 | 112 | 292 |
Sales Executive | 62 | 63 | 94 | 107 | 326 |
Sales Representative | 9 | 20 | 24 | 30 | 83 |
Grand Total | 264 | 269 | 419 | 518 | 1,470 |
Job_Category | 1 | 2 | 3 | 4 | Grand_Total |
---|---|---|---|---|---|
Healthcare Representative | 26 | 29 | 35 | 41 | 131 |
Human Resources | 6 | 8 | 20 | 18 | 52 |
Laboratory Technician | 44 | 55 | 98 | 62 | 259 |
Manager | 14 | 24 | 31 | 33 | 102 |
Manufacturing Director | 21 | 38 | 46 | 40 | 145 |
Research Director | 14 | 17 | 29 | 20 | 80 |
Research Scientist | 60 | 60 | 78 | 94 | 292 |
Sales Executive | 72 | 54 | 99 | 101 | 326 |
Sales Representative | 19 | 18 | 23 | 23 | 83 |
Grand Total | 276 | 303 | 459 | 432 | 1,470 |
Job_Category | 1 | 2 | 3 | 4 | Grand_Total |
---|---|---|---|---|---|
Healthcare Representative | 10 | 30 | 80 | 11 | 131 |
Human Resources | 4 | 6 | 32 | 10 | 52 |
Laboratory Technician | 20 | 58 | 156 | 25 | 259 |
Manager | 6 | 23 | 61 | 12 | 102 |
Manufacturing Director | 7 | 34 | 90 | 14 | 145 |
Research Director | 4 | 15 | 49 | 12 | 80 |
Research Scientist | 16 | 86 | 166 | 24 | 292 |
Sales Executive | 12 | 76 | 202 | 36 | 326 |
Sales Representative | 1 | 16 | 57 | 9 | 83 |
Grand Total | 80 | 344 | 893 | 153 | 1,470 |
DEPARTMENTWISE
EDUCATIONWISE
GENDERWISE
Created by Analyst Julius
---
title: "HR ANALYTIC DASHBOARD"
output:
flexdashboard::flex_dashboard:
css: styles.css
orientation: row
vertical_layout: scroll
theme: paper
source_code: embed
social: ["menu"]
---
```{r setup, include=FALSE}
library(flexdashboard)
library(flextable)
library(tidyverse)
library(rpivotTable)
library(plotly)
hr <- read.csv("HR DATA_Excel.xlsx - Data.csv")
```
Demographics {data-icon="fa-list}
====================================================================
Row
---------------------------------------------------------------------
### Employee Count
```{r}
valueBox(length(hr$Attrition), icon = "ion-android-contacts", color = "red")
```
### Attrition Count
```{r}
valueBox(hr %>%
filter(Attrition == "Yes") %>% count(),
icon = "fa-user", color = "red")
```
### Attrition rate
```{r}
yes <- hr %>%
filter(Attrition == "Yes")
valueBox(paste(round((length(yes$Attrition)/length(hr$Attrition))*(100),0),"%"),icon = "fa-user", color = "red")
```
### Active Employees
```{r}
valueBox(length(hr$Attrition)- length(yes$Attrition), icon = "fa-user", color = "red")
```
### Average age
```{r}
valueBox(round(mean(hr$Age),0), icon = "fa-user", color = "red")
```
### Maximum monthly rate
```{r}
a <- hr %>%
filter(Attrition == "No")
valueBox(max(a$Monthly.Rate), color = "red")
```
### Minimum monthly rate
```{r}
valueBox(min(a$Monthly.Rate), color = "red")
```
Row
------------------------------------------------------------------------
### Attrition by Gender
```{r}
g <- yes %>% select(Attrition,Gender) %>%
group_by(Gender) %>%
summarise(count = n()) %>%
ggplot(aes(Gender, count, label = count, fill = Gender))+geom_col()+geom_text(aes(vjust = 2), size = 5)+
theme(legend.position = "none",axis.text.x = element_text(face = "bold", colour = "black", size = 10))
g+theme_classic(base_size = 15)
```
### Department wise Attrition
```{r}
yes %>% group_by(Department) %>%
summarise(count = n()) %>%
plot_ly(labels = ~Department,
values =~count) %>%
add_pie()
```
### No of Employees by Age
```{r}
a <- hr %>%
filter(Attrition == "No")
p <- a %>%
group_by(Age) %>%
summarise(age_count = n()) %>%
ggplot(aes(Age, age_count, fill = age_count))+geom_col()+
labs(y = "count")
p+theme_classic(base_size = 15)
```
Row
-----------------------------------------------------
### Education Field wise Attrition
```{r}
y <- yes %>%
group_by(Education.Field) %>%
summarise(count = n()) %>%
ggplot(aes(fct_reorder(Education.Field,count),count, fill = Education.Field))+theme_classic(base_size = 15)+geom_col()+geom_text(aes(label = count, hjust = 2))+
theme(legend.position = "none")
y2 <- y+theme(axis.text.x = element_text(face = "bold", colour = "black", size = 10),plot.background = element_rect(colour = "grey"))
y2+
labs(x = "Education Field")+coord_flip()
```
### Education qualification Attrition
```{r}
z <- yes %>%
group_by(Education) %>%
summarise(count = n()) %>%
ggplot(aes(fct_reorder(Education,count),count, fill = Education))+theme_classic(base_size = 15)+
geom_col()+geom_text(aes(label = count, hjust = 2))+
theme(legend.position = "none")
z2 <- z+theme(axis.text.x = element_text(face = "bold", colour = "black"))
z2+coord_flip()+labs(x = "Education")
```
### monthly rate per job role
```{r}
a %>%
group_by(Job.Role) %>%
summarise(average_monthtly_rate = round(mean(Monthly.Rate)),0) %>%
ggplot(aes(fct_reorder(Job.Role,average_monthtly_rate),average_monthtly_rate, label =average_monthtly_rate))+theme_classic(base_size = 15)+
geom_col(fill = "blue")+geom_text(aes(hjust = 1), size = 5)+theme(axis.text.x = element_text(angle = 45, color = "black"))+labs(
y = "Average Monthly Rate", x ="Job Role",
)+
coord_flip()
```
Job Satisfaction
=========================================================
Column {data-height=550}
---------------------------------------------------------
### Job Satisfaction
```{r}
hr1 <- hr %>% select(10,Job.Satisfaction)
t <- table(hr1$Job.Role, hr1$Job.Satisfaction)
t1<- t %>% as.data.frame() %>% pivot_wider(id_cols = 1, names_from = "Var2", values_from = "Freq") %>% data.frame() %>%
mutate(Grand_Total= X1+X2+X3+X4)
t_sum <- data.frame(colSums(t1[,-1]))
t_sum <- t_sum %>% rename(Grand_total = "colSums.t1....1..")
t_sum2 <- data.frame(t(t_sum))
tab <- t1 %>% full_join(t_sum2)
tab$Var1 <- as.character(tab$Var1)
tab <- tab %>% replace_na(list(Var1="Grand Total"))
tt <- tab %>% rename(Job_Category = "Var1",
"1"= "X1",
"2"="X2",
"3"="X3",
"4"="X4") %>%
flextable::flextable()
theme_tron(tt)
```
### Environment Satisfaction
```{r}
hr2 <- hr %>% select(10,Environment.Satisfaction)
e<- table(hr2$Job.Role, hr2$Environment.Satisfaction)
te<- e %>% as.data.frame() %>% pivot_wider(id_cols = 1, names_from = "Var2", values_from = "Freq") %>% data.frame() %>%
mutate(Grand_Total= X1+X2+X3+X4)
te_sum <- data.frame(colSums(te[,-1]))
te_sum <- te_sum %>% rename(Grand_total = "colSums.te....1..")
te_sum2 <- data.frame(t(te_sum))
tab_e <- te %>% full_join(te_sum2)
tab_e$Var1 <- as.character(tab_e$Var1)
tab_e <- tab_e %>% replace_na(list(Var1="Grand Total"))
tt_e <- tab_e %>% rename(Job_Category = "Var1",
"1"= "X1",
"2"="X2",
"3"="X3",
"4"="X4") %>%
flextable::flextable()
theme_tron_legacy(tt_e)
```
Column {data-height=550}
----------------
### Relationship Satisfaction
```{r}
hr3 <- hr %>% select(10, Relationship.Satisfaction)
r<- table(hr3$Job.Role, hr3$Relationship.Satisfaction)
tr<- r %>% as.data.frame() %>% pivot_wider(id_cols = 1, names_from = "Var2", values_from = "Freq") %>% data.frame() %>%
mutate(Grand_Total= X1+X2+X3+X4)
tr_sum <- data.frame(colSums(tr[,-1]))
tr_sum <- tr_sum %>% rename(Grand_total = "colSums.tr....1..")
tr_sum2 <- data.frame(t(tr_sum))
tab_r <- tr %>% full_join(tr_sum2)
tab_r$Var1 <- as.character(tab_r$Var1)
tab_r <- tab_r %>% replace_na(list(Var1="Grand Total"))
tt_r <- tab_r %>% rename(Job_Category = "Var1",
"1"= "X1",
"2"="X2",
"3"="X3",
"4"="X4") %>%
flextable::flextable()
theme_tron(tt_r)
```
### Work Life Balance
```{r}
hr4 <- hr %>% select(10, Work.Life.Balance)
w<- table(hr4$Job.Role, hr4$Work.Life.Balance)
tw<- w %>% as.data.frame() %>% pivot_wider(id_cols = 1, names_from = "Var2", values_from = "Freq") %>% data.frame() %>%
mutate(Grand_Total= X1+X2+X3+X4)
tw_sum <- data.frame(colSums(tw[,-1]))
tw_sum <- tw_sum %>% rename(Grand_total = "colSums.tw....1..")
tw_sum2 <- data.frame(t(tw_sum))
tab_w <- tw %>% full_join(tw_sum2)
tab_w$Var1 <- as.character(tab_w$Var1)
tab_w <- tab_w %>% replace_na(list(Var1="Grand Total"))
tt_w <- tab_w %>% rename(Job_Category = "Var1",
"1"= "X1",
"2"="X2",
"3"="X3",
"4"="X4") %>%
flextable::flextable()
theme_tron_legacy(tt_w)
```
Job Progress {data-orientation=columns}
=================================================
Column {.tabset}
---------------------------------------------
DEPARTMENTWISE
### Years.In.Current.Role
```{r}
hr_job <- hr %>%
select(Years.At.Company,Years.In.Current.Role,Years.Since.Last.Promotion,
Years.With.Curr.Manager,Department,Gender,Education,Attrition ) %>%
filter(Attrition == "No")
hr_job %>%
select(Department,Years.In.Current.Role) %>%
dplyr::group_by(Department) %>%
summarise(year = round(median(Years.In.Current.Role))) %>%
ggplot(aes(Department, year, label = year))+geom_col(fill = "red")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)
```
### Years.At.Company
```{r}
hr_job %>%
select(Department,Years.At.Company) %>%
dplyr::group_by(Department) %>%
summarise(year = round(median(Years.At.Company))) %>%
ggplot(aes(Department, year,label = year))+geom_col(fill = "steelblue")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)
```
### Years.Since.Last.Promotion
```{r}
hr_job %>%
select(Department,Years.Since.Last.Promotion) %>%
dplyr::group_by(Department) %>%
summarise(year = round(median(Years.Since.Last.Promotion))) %>%
ggplot(aes(Department, year,label = year))+geom_col(fill = "green")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)
```
### Years.With.Curr.Manager
```{r}
hr_job %>%
select(Department,Years.With.Curr.Manager) %>%
dplyr::group_by(Department) %>%
summarise(year = round(median(Years.With.Curr.Manager))) %>%
ggplot(aes(Department, year, label = year))+geom_col(fill = "blue")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)
```
Column {.tabset}
------------------------------------
EDUCATIONWISE
### Years.At.Company
```{r}
hr_job %>%
select(Education,Years.At.Company) %>%
dplyr::group_by(Education) %>%
summarise(year = round(median(Years.At.Company))) %>%
ggplot(aes(fct_reorder(Education, year), year, label = year))+geom_col(fill = "steelblue")+
geom_text(aes(hjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)+labs(x = "Education Level")+coord_flip()
```
### Years.Since.Last.Promotion
```{r}
hr_job %>%
select(Education,Years.Since.Last.Promotion) %>%
dplyr::group_by(Education) %>%
summarise(year = round(median(Years.Since.Last.Promotion))) %>%
ggplot(aes(fct_reorder(Education, year), year, label = year))+geom_col(fill = "green")+
geom_text(aes(hjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)+labs(x = "Education Level")+coord_flip()
```
### Years.In.Current.Role
```{r}
hr_job %>%
select(Education,Years.In.Current.Role) %>%
dplyr::group_by(Education) %>%
summarise(year = round(median(Years.In.Current.Role))) %>%
ggplot(aes(fct_reorder(Education, year), year,label = year))+geom_col(fill = "red")+
geom_text(aes(hjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)+labs(x = "Education Level")+coord_flip()
```
### Years.With.Curr.Manager
```{r}
hr_job %>%
select(Education,Years.With.Curr.Manager) %>%
dplyr::group_by(Education) %>%
summarise(year = round(median(Years.With.Curr.Manager))) %>%
ggplot(aes(fct_reorder(Education, year), year, label = year))+geom_col(fill = "blue")+
geom_text(aes(hjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)+labs(x = "Education Level")+coord_flip()
```
Column {.tabset}
------------------------------------
GENDERWISE
### Years.At.Company
```{r}
hr_job %>%
select(Gender,Years.At.Company) %>%
dplyr::group_by(Gender) %>%
summarise(year = round(median(Years.At.Company))) %>%
ggplot(aes(fct_reorder(Gender, year), year, label = year))+geom_col(fill = "steelblue")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)+labs(x = "Gender")
```
### Years.Since.Last.Promotion
```{r}
hr_job %>%
select(Gender,Years.Since.Last.Promotion) %>%
dplyr::group_by(Gender) %>%
summarise(year = round(median(Years.Since.Last.Promotion))) %>%
ggplot(aes(fct_reorder(Gender, year), year, label = year))+geom_col(fill = "green")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15
)+labs(x = "Gender")
```
### Years.In.Current.Role
```{r}
hr_job %>%
select(Gender,Years.In.Current.Role) %>%
dplyr::group_by(Gender) %>%
summarise(year = round(median(Years.In.Current.Role))) %>%
ggplot(aes(fct_reorder(Gender, year), year, label = year))+geom_col(fill = "red")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)+labs(x = "Gender")
```
### Years.With.Curr.Manager
```{r}
hr_job %>%
select(Gender,Years.With.Curr.Manager) %>%
dplyr::group_by(Gender) %>%
summarise(year = round(median(Years.With.Curr.Manager))) %>%
ggplot(aes(fct_reorder(Gender, year), year, label = year))+geom_col(fill = "blue")+
geom_text(aes(vjust = 2), colour = "white", size = 8)+theme_classic(
base_size = 15)+
labs(x = "Gender")
```
ABOUT
============================================================
Created by Analyst Julius