R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

library(readr)
## Warning: package 'readr' was built under R version 4.3.3
HR_comma_sep <- read_csv("HR_comma_sep.csv")
## Rows: 14999 Columns: 10
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (2): sales, salary
## dbl (8): satisfaction_level, last_evaluation, number_project, average_montly...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(HR_comma_sep)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.3

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

hist(HR_comma_sep$last_evaluation, 
     main = "Evaluation Insights: Most Employees Score Over 0.50", 
     xlab = "Last Evaluation Score", 
     col = "red", 
     border = "black",
     breaks = 20)

avg_satisfaction <- aggregate(satisfaction_level ~ left, data = HR_comma_sep , mean)

avg_satisfaction$left <- factor(avg_satisfaction$left, labels = c("Stayed", "Left"))
ggplot(avg_satisfaction, aes(x = left, y = satisfaction_level, fill = left)) +
  geom_bar(stat = "identity") +
  labs(title = "Employee Retention: Satisfaction Levels Among Those Who Stayed and Left", x = "Employee Status", y = "Average Satisfaction Level") +
  theme_minimal()