We will take a look at real-life, sample data of employee’s performance for 2018-2020. As with real data, there will be N/A data within columns. With this data, we will particularly look at the organization’s performance/achievement as a whole.
Lastly, we will also use the employee’s past performance data (“penilaian kinerja” or “PK” for short) to view who were the best performer within 2016-2019.
We will use the following library:
library(tidyverse)
## ── Attaching packages ──────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.2.1 ✓ purrr 0.3.3
## ✓ tibble 2.1.3 ✓ dplyr 0.8.4
## ✓ tidyr 1.0.2 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.4.0
## ── Conflicts ─────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(glue)
##
## Attaching package: 'glue'
## The following object is masked from 'package:dplyr':
##
## collapse
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
library(scales)
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
library(lubridate)
##
## Attaching package: 'lubridate'
## The following object is masked from 'package:base':
##
## date
library(readxl)
# Read the data
goals <- read_xls("goals_cut.xls") %>%
mutate(review_year = year(review_date))
pk <- read_xls("PK.xls")
# Data preparation
rating.recap <- goals %>%
drop_na(rating) %>%
mutate(review_year = year(review_date)) %>%
group_by(review_year, rating) %>%
summarise(rating.count = length(rating)) %>%
mutate(rating = as.factor(rating)) %>%
mutate(rating = factor(rating, levels=c("Need Improvement", "Meet Expectation", "Exceed Expectation", "Outstanding"))) %>%
arrange(rating) %>%
ungroup() %>%
mutate(label=glue(
"No. objectives: {rating.count}"
))
## Warning in mutate_impl(.data, dots, caller_env()): Unequal factor levels:
## coercing to character
## Warning in mutate_impl(.data, dots, caller_env()): binding character and factor
## vector, coercing into character vector
## Warning in mutate_impl(.data, dots, caller_env()): binding character and factor
## vector, coercing into character vector
## Warning in mutate_impl(.data, dots, caller_env()): binding character and factor
## vector, coercing into character vector
We will look at overall organization’s achievement by following code:
rating.plot <- ggplot(rating.recap, aes(x=rating, y=rating.count))+
geom_col(aes(fill=rating, text = label))+
scale_fill_manual(values = c("#CC3333", "#E7B800", "#009933", "#0033FF"))+
labs(title = "Organization's Performance Recap",
subtitle = "Organization's Performance is still on-track/meet the expectations",
x = "Rating",
y = "# of Objectives Reviewed")+
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
)
## Warning: Ignoring unknown aesthetics: text
rating.plot
Below are the work progress for each person who have “Analyst” job role:
analyst <- goals %>%
group_by(owner_initial, state) %>%
filter(job_role == "Analyst") %>%
summarise(goalcount = length(owner_initial)) %>%
ungroup() %>%
mutate(state = factor(state, levels=c("reviewed", "running", "completed"))) %>%
mutate(label=glue(
"# objectives: {goalcount}"
))
analyst.plot <- ggplot(analyst, aes(x=owner_initial, y=goalcount))+
geom_col(aes(fill=state))+
scale_fill_manual(values = c("#99CCCC", "#33CC99", "#336666"))+
theme_linedraw()+
labs(title = "Analyst Progress for Q1",
x = "Name",
y = "# of Objectives")+
theme(axis.text.x = element_text(angle = 90, hjust = 1),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_rect(fill = "transparent",colour = NA),
plot.background = element_rect(fill = "transparent",colour = NA)
)
analyst.plot
Below are the work progress for each person who have “Analyst” job role:
freelance <- goals %>%
group_by(owner_initial, state) %>%
filter(job_role == "Freelance/Interns") %>%
summarise(goalcount = length(owner_initial)) %>%
ungroup() %>%
mutate(state = factor(state, levels=c("reviewed", "running", "completed"))) %>%
mutate(ant.label=glue(
"# objectives: {goalcount}"
))
freelance.plot <- ggplot(freelance, aes(x=owner_initial, y=goalcount))+
geom_col(aes(fill=state))+
scale_fill_manual(values = c("#99CCCC", "#33CC99", "#336666"))+
theme_linedraw()+
labs(title = "Freelance/Intern Progress for Q1",
x = "Name",
y = "# of Objectives")+
theme(axis.text.x = element_text(angle = 90, hjust = 1),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_rect(fill = "transparent",colour = NA),
plot.background = element_rect(fill = "transparent",colour = NA)
)
freelance.plot
Management sometimes have to look at past performance of each individual in organization, whether to decide on reward, development program given, or just to decide who can actually work further beyond his/her peers. For this purpose, we will use past PK (penilaian kinerja) data, compiled from 2016-2019.
However, we will only use the most recent data from 2019 for this purpose.
pk1 <- pk %>%
filter(year == 2019, Position == "Analyst") %>%
drop_na(PK) %>%
mutate(label=glue(
"PK of the year: {PK},
Name: {Initial}"))
pk.plot <- ggplot(pk1, aes(x=length(Initial), y=PK))+
geom_jitter(aes(color=Initial, text = label))+
theme_linedraw()+
labs(title = "Past Individual Performance Score (PK)",
x = "Count of PK",
y = "PK")+
geom_smooth(method="lm")+
theme(axis.text.x = element_text(angle = 90, hjust = 1),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
)
## Warning: Ignoring unknown aesthetics: text
Because on the scatter plot above we cannot rank the individual based on their score, let’s change the chart into barplot:
pk.plot
pk.flip <- ggplot(pk1, aes(x= reorder(Initial, PK), y=PK, label = PK))+
geom_col(aes(fill=PK))+
geom_text(size = 3, position = position_stack(vjust = 0.5))+
coord_flip()+
scale_fill_gradient(low = "#99CCCC", high = "#33CC99")+
labs(title = "Individual Performance Ranking",
x = "Name",
y = "Score")
pk.flip