Here is a possible example:
library(dplyr)
library(ggplot2)
df <- structure(list(Months = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
Software = c(rep("Twitter", 10),
rep("Facebook", 10),
rep("Chat GPT", 10)),
Users = c(50, 10, 200, 400, 800, 160, 3200, 6400, 1280, 2000,
4000, 800, 1600, 3200, 6400, 128000, 2560, 5120, 102400, 150,
6000, 1200, 2400, 400, 960, 19200, 3800, 7680, 1000, 20)),
class = "data.frame", row.names = c(NA, -30L),
.Names = c("Months", "Software", "Users"))
df %>%
mutate(Cumulative_Users = cumsum(Users)) %>%
group_by(Software) %>%
filter(Cumulative_Users >= 10000) %>%
summarise(Months_to_10000= min(Months)) %>%
ggplot(aes(x = Months_to_10000, y = reorder(Software, Months_to_10000))) +
geom_col() +
labs(x = "Months to reach 10000 users", y = "Software") +
geom_text(aes(label = paste(round(Months_to_10000, 1), "months")), hjust = -0.1)+
theme_minimal()
