I have a ggplot graph and I want to draw two lines on it (from different columns, but for the same date). What I get are two lines that are stacked on each other, but I want to have the same y-axis, ordered correctly, with the lines overlapping each other.
This is the data I'm trying to plot:
final_table:
Month a b
1 2018-04 758519.397875 2404429.258675
2 2018-05 964792.603725 1995902.14473
3 2018-06 703170.240575 1294997.84319
This is my code:
bla3 <- melt(final_table, id='Month')
ggplot(data=bla3, aes(x=Month, y=value, colour= variable, group=variable)) +
geom_line()
And the output I get (notice the y-axis is totally wrong and unordered).