Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206305

Date on X axis is not in date format in R visualization

$
0
0

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.

enter image description here

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 excepting to see all days, or at least group them by month... But do not know how can I do it

P.S. This is my dataset, It an excel file with rows like below, I upload it as a DataModel in SAP Analytics and read it.

enter image description here

Many thanks


Viewing all articles
Browse latest Browse all 206305

Trending Articles