I am having a problem with Date in R, in my dataset the format of my date is like this: 15.01.2018
, but in my X, I see [0, 50, 100, ...]
instead of date.
This is my simple program to have a line chart that X axis should be my date (that is 365 days), could you please let me know what is my mistake?
library(ggplot2)
v <- MyDataSet$ACTUAL/100000
t <- MyDataSet$FORECAST/100000
mese <- as.Date(MyDataSet$CalDay , format = "%m.%d.%Y", frequency = 6)
plot(v,type = "l",col = "red", xlab = mese, ylab = "Actual in Milion",
main = "Actual Forecst")
lines(t, type = "l", col = "blue")
I was expecting to see all days, or at least group them by month... But do not know how I can do it.
P.S. This is my dataset, it's an Excel file with rows like below, I upload it as a DataModel in SAP Analytics and read it.
Many thanks
I am not sure what kind of output you expect. The plot below is
forecast
bydate
and the color is theactual
.Output
Data