Base de datos extraída de Kaggle en 6 archivos .csv individuales cada uno perteneciente a un mes. Se revisa base de datos y unifican con Mysql en una sola tabla al comprobar en la exploración que son columnas coincidentes facilitando su manipulación.
callcenter <- read.csv("C:/Users/Patricia/Desktop/cursos/PORTAFOLIO/call center semestre.csv", sep = ";", header = TRUE, stringsAsFactors = FALSE)
callcenter
## 'data.frame': 3000 obs. of 8 variables:
## $ Date : chr "16/01/2024" "10/01/2024" "29/01/2024" "30/01/2024" ...
## $ AgentID : chr "A1504" "A1030" "A1200" "A1289" ...
## $ TotalCalls : int 119 170 60 150 110 148 113 57 54 70 ...
## $ AnsweredCalls : int 107 69 52 128 95 59 68 54 48 57 ...
## $ AbandonedCalls : int 12 101 8 22 15 89 45 3 6 13 ...
## $ SpeedOfAnswer : num 51.1 46 39 54.5 32.1 ...
## $ CallLength : num 420 419 497 879 606 ...
## $ CustomerSatisfaction: int 5 4 2 4 1 3 2 5 1 5 ...
## Date AgentID TotalCalls AnsweredCalls
## Length:3000 Length:3000 Min. : 50.00 Min. : 40.00
## Class :character Class :character 1st Qu.: 86.25 1st Qu.: 54.00
## Mode :character Mode :character Median :125.00 Median : 73.00
## Mean :125.13 Mean : 82.97
## 3rd Qu.:165.00 3rd Qu.:105.00
## Max. :200.00 Max. :199.00
## NA's :2 NA's :2
## AbandonedCalls SpeedOfAnswer CallLength CustomerSatisfaction
## Min. : 0.00 Min. :10.01 Min. :180.2 Min. :1.000
## 1st Qu.: 13.00 1st Qu.:21.76 1st Qu.:367.5 1st Qu.:2.000
## Median : 33.00 Median :33.73 Median :537.8 Median :3.000
## Mean : 42.16 Mean :34.46 Mean :540.4 Mean :3.024
## 3rd Qu.: 63.00 3rd Qu.:47.26 3rd Qu.:715.5 3rd Qu.:4.000
## Max. :159.00 Max. :59.96 Max. :900.0 Max. :5.000
## NA's :2 NA's :1 NA's :2
library(dplyr)
library(ggplot2)
callcenter$Month <- month(callcenter$Date, label = TRUE, abbr = FALSE, locale = "es_ES.utf8")
Llamadas_por_mes <- callcenter %>%
group_by(Month) %>%
summarise(Respondidas = sum(AnsweredCalls, na.rm = TRUE))
ggplot(Llamadas_por_mes, aes(x = Month, y = Respondidas)) +
geom_bar(stat = "identity", fill = "steelblue") + geom_text(aes(label = format(Respondidas, big.mark = ".", decimal.mark = ",")),
vjust = 1.5, color = "Black", size = 3.5) +
labs(title = "Llamadas Respondidas por Mes", x = "Mes", y = "Cantidad de llamadas") +
theme_minimal()
TiempoRespuesta <- callcenter %>%
group_by(Month) %>%
summarise(Promedio = mean(SpeedOfAnswer, na.rm = TRUE))
TiempoRespuesta <- callcenter %>%
group_by(Month) %>%
summarise(Promedio = mean(SpeedOfAnswer, na.rm = TRUE))
ggplot(TiempoRespuesta, aes(x = Month, y = Promedio, group = 1)) +
geom_line(color = "darkblue", size = 1.2) +
geom_point(color = "black", size = 3) +
geom_text(aes(label = round(Promedio, 1)),
vjust = -0.8, color = "black", size = 3.5) +expand_limits(y = max(TiempoRespuesta$Promedio) * 1.1) +
labs(
title = "Tiempo Promedio de Respuesta por Mes",
x = "Mes",
y = "Segundos"
) +
theme_minimal()
niveldeAtencion <- callcenter %>%
summarise(
Atendidas = sum(AnsweredCalls, na.rm = TRUE),
Abandonadas = sum(AbandonedCalls, na.rm = TRUE)
) %>%
pivot_longer(cols = everything(), names_to = "Tipo", values_to = "Cantidad") %>%
mutate(Porcentaje = Cantidad / sum(Cantidad))
ggplot(niveldeAtencion, aes(x = "", y = Porcentaje, fill = Tipo)) +
geom_col(width = 1, color = "white") +
coord_polar(theta = "y") +
geom_text(
aes(label = scales::percent(Porcentaje, accuracy = 0.1, decimal.mark = ",")),
position = position_stack(vjust = 0.5),
color = "black", size = 4
) +
scale_fill_manual(values = c("Atendidas" = "#7B1FA2", "Abandonadas" = "#CE93D8")) +
labs(title = "Porcentaje de Llamadas Atendidas y Abandonadas") +
theme_void()
satisfaccion_mes <- callcenter %>%
group_by(Month) %>%
summarise(PromedioSatisfaccion = mean(CustomerSatisfaction, na.rm = TRUE))
ggplot(satisfaccion_mes, aes(x = Month, y = "Satisfacción", fill = PromedioSatisfaccion)) +
geom_tile(color = "white", width = 0.9, height = 0.9) +
scale_fill_gradient(
low = "pink",
high = "deeppink",
name = "Promedio"
) +
geom_text(aes(label = round(PromedioSatisfaccion, 1)),
color = "black", size = 4) +
labs(
title = "Promedio satisfacción del cliente (1-5)",
x = "Mes",
y = NULL
) +
theme_minimal() +
theme(
axis.text.y = element_blank(),
axis.ticks.y = element_blank()
)
Enero fue el mes con más llamadas atendidas y febrero el que menos, aunque en febrero se observa un tiempo promedio de respuesta inferior que en enero. El porcentaje de llamadas abandonadas es alto. El cliente califica su satisfaccion en torno a una valoración de 3 sobre 5.