My dates dataframe looks like this:
Date Values
1JAN2018 80
23DEC2019 21.3
... ...
How can I format this into a ddmmyyyy date so that I can use ggplot to create a time series plot?
What did I do?
Date <- as.Date(Date, '%d%m%Y')
But unfortunately, that didn't seem to do the trick.
Thank you so much! :D
EDIT:
Thanks for the answers. This is my current plot. Is it possible to smoothen this out more? It seems very static:
Both values are measured several times (HH, MM) at the same time each day (around 40 times). When using your code:
ggplot(aug, aes(aug$DATE)) +
#geom_smooth(stat = "identity") +
geom_line(aes(y = aug$VALUE_ONE, colour = "aug$VALUE_ONE")) +
geom_line(aes(y = aug$VALUE_TWO, colour = "aug$VALUE_TWO")) +
ggtitle("Time Series Data)")+
xlab("Time")+
ylab("Value")+
theme(axis.text.x = element_text(angle = 60, hjust = 1),
plot.title = element_text(hjust = 0.5))
EDIT2:
Thanks again for the answers. To get a better view of the data, the data is as follows:
Date ValueOne ValueTwo Time
1JAN2018 20 11 05:22
1JAN2018 25 12 05:33
1JAN2018 34 44 05:59
1JAN2018 32 55 06:30
1JAN2018 4 88 06:48
1JAN2018 11 78 10:33
1JAN2018 12 100 15:33
Every day has around 40 measures of both ValueOne and ValueTwo at different moments on that day. Because there are so many measurements, the line stays static to me unless I plot a single day for example. In that case it works well. Do you ave any idea?
