I have a dataset of cumulative returns (called Merged_Returns_Set), which looks like this:
Time USD_THB_Close USD_CNH_Close JP225_USD_Close USD_MXN_Close GBP_USD_Close IN50_USD_Close
<dttm> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 2017-12-13 20:00:00 1.00 1.00 1.00 1.00 1.00 1.00
2 2017-12-13 20:15:00 1.000 1.000 0.999 0.998 1.00 1.00
3 2017-12-13 20:30:00 1.00 0.999 1.00 0.999 1.00 1.00
4 2017-12-13 20:45:00 1.000 1.000 1.00 1.000 1.00 1.00
I wanted to plot all cumulative returns plot on one ggplot, so after browsing stackoverflow, I came up with the following solution:
df.melted <- reshape::melt(data.frame(Returns_Data_Set), id = "Time")
ggplot(data = df.melted, aes(x = Time, y = value, color = variable)) +
geom_point() + theme(legend.position="none")
The pertinent part of the dataset df.melted, which is used for the ggplot, looks like this (the same for all symbols):
191 2017-12-15 22:45:00 USD_THB_Close 0.9996249
192 2017-12-15 23:00:00 USD_THB_Close 0.9995326
193 2017-12-17 23:15:00 USD_THB_Close 0.9999015
194 2017-12-18 00:00:00 USD_THB_Close 0.9997478
195 2017-12-18 00:15:00 USD_THB_Close 0.9997785
Looking at the plot below, how can I tell R to skip the dates on the x-axis, for which there is no data?