I am struggling to find if it is possible to plot a secondary x-axis (on the top of the linegraph if possible) using an entirely different column in the dataset. I've been looking for a while, so apologies if this has been answered already. For example:
Day <- c(1:10)
Revenue <- c(100,200,300,400,550,600,750,800,975,1000)
Date <- c("1/1","1/5","1/10","1/11","1/14","1/15","1/18","1/21","1/28","1/31")
a <- data.frame(Day,Revenue,Date)
I can plot "Day" on the x-axis and "Revenue" on the y-axis:
ggplot(a,(aes(Day,Revenue))) + geom_line(aes(y = Revenue))
However, is it possible to have the corresponding "Date" included at the top of the graph on a secondary x-axis that matches the primary x-axis ("Day")? Thank you in advance for any help on this!