I have a ggplot graph and I want it to show the data from down to up. I know how to reorder based on the the number of entry but not in another way. Those are dates used as factor.
This is a normal graph
x <- ggplot(data, aes(y = factor(date), fill=category))
y<- x+geom_bar()+ggtitle("Number of articles per date")+
labs(y = "date", fill = "category")
print(y)
This is what I tried with no effect:
data %>% arrange(date) %>%
ggplot(aes(y = factor(date), fill=category))+
geom_bar()+ggtitle("Number of articles per date")+
labs(y = "date", fill = "category")
Perhaps there is a way to use the column "date" as as.Date() but I don't know how to use the count of entry per date with as.Date.
Any idea?
