I have the dataframe below and I want to display the values in the x-axis as actual dates and not as months.
Targets2<-structure(list(Week = structure(c(17903, 17903, 17910, 17910,
17917, 17917, 17924, 17924, 17931, 17931, 17938, 17938, 17945,
17945, 17952, 17952, 17959, 17959, 17966, 17966, 17973, 17973,
17980, 17980, 17987, 17987, 17994, 17994, 18001, 18001, 18008,
18008, 18015, 18015, 18022, 18022, 18029, 18029, 18036, 18036
), class = "Date"), Type = c("Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target", "Target", "Cumilative target", "Target",
"Cumilative target"), Count = c(5, 5, 8, 13, 15, 28, 20, 48,
25, 73, 25, 98, 25, 123, 25, 148, 25, 173, 25, 198, 25, 223,
25, 248, 25, 273, 25, 298, 25, 323, 25, 348, 25, 373, 25, 398,
25, 423, 25, 448)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-40L))
p <-
ggplot(Targets2, aes(x = Week, y = Count, fill = Type))+
geom_area(alpha = 0.6 , size = 0.5, colour = "white", stat = "identity", orientation = "x") +
scale_fill_viridis(discrete = TRUE) +
labs(fill = NULL)+
theme_ipsum() +
ggtitle("Figure 1: Weekly Cumulative Projected Enrollment vs Weekly Cumulative Actual Enrollment")+
theme(legend.position = "bottom")
p
# not printed
ggplotly(p)