library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.5.1
data <- read.csv("C:/Users/User/OneDrive/Desktop/SEP.csv", stringsAsFactors = FALSE)
head(data)
## Name Years.of.Experience graduate CPA Technical.skills ATD
## 1 Cynthia Njoroge 1 0 1 1 0
## 2 Churchil Odhiambo 3 1 0 1 0
## 3 Fredrick Sawayi 30 1 1 1 0
## 4 Kelvin Mithamo 2 1 0 1 0
## 5 Fred Masinde 16 1 1 1 0
## 6 Stephen Mwongela 9 1 1 1 0
library(DT)
## Warning: package 'DT' was built under R version 4.5.1
datatable(data)
# Filter candidates with ATD = 1
shortlist <- data %>%
filter(ATD == 1)
# Bar chart: Years of Experience for shortlisted candidates
ggplot(shortlist, aes(x = reorder(Name, Years.of.Experience),
y = Years.of.Experience,
fill = Years.of.Experience)) +
geom_bar(stat = "identity") +
coord_flip() +
labs(title = "Shortlisted Candidates (ATD = 1)",
x = "Candidate Name",
y = "Years of Experience") +
theme_minimal()
