library(flexdashboard) library(readxl) library(tidyverse) library(plotly) library(scales) library(janitor)
datos <- read_excel(“Top10_EPS_Mensual_2025.xlsx”) %>% clean_names()
datos\(mes <- as.Date(datos\)mes)
valueBox( dollar(sum(datos$total_girado)), icon = “fa-coins”, color = “primary” )
valueBox( length(unique(datos$eps)), icon = “fa-hospital”, color = “info” )
valueBox( length(unique(datos$nombre_prestador)), icon = “fa-user-md”, color = “success” )
tendencia <- datos %>% group_by(mes) %>% summarise(total = sum(total_girado))
g1 <- ggplot(tendencia, aes(x = mes, y = total)) + geom_line(size = 1.2, color = “#2C3E50”) + geom_point(size = 2, color = “#1ABC9C”) + scale_y_continuous(labels = dollar) + theme_minimal(base_size = 14) + labs(x = “Mes”, y = “Total Girado”)
ggplotly(g1) top_prestadores <- datos %>% group_by(nombre_prestador) %>% summarise(total = sum(total_girado)) %>% arrange(desc(total)) %>% slice_head(n = 10)
g2 <- ggplot(top_prestadores, aes(x = reorder(nombre_prestador, total), y = total)) + geom_col(fill = “#2C3E50”) + coord_flip() + scale_y_continuous(labels = dollar) + theme_minimal(base_size = 14) + labs(x = “Prestador”, y = “Total Girado”)
ggplotly(g2)
eps_totales <- datos %>% group_by(eps) %>% summarise(total = sum(total_girado)) %>% arrange(desc(total))
g3 <- ggplot(eps_totales, aes(x = reorder(eps, total), y = total)) + geom_col(fill = “#1ABC9C”) + coord_flip() + scale_y_continuous(labels = dollar) + theme_minimal(base_size = 14) + labs(x = “EPS”, y = “Total Girado”)
ggplotly(g3)