I need to overlay multiple days of a variable onto one plot. The values are recorded in a non-uniform way. Say there can be two values with a second of difference and others with a minute from the prior value.
I have a dataset called eventos
which has a column named fecha
as YYYY-MM-DD hh:mm:ss
and a column named velocidad
, both as a factor and I need to compare the values recorded according to the time of the day.
I have created and xts variable xts.velocidad using the dates as POSIXct which, just for visualization purposes, I can separate in days to plot alone as xts.velocidad["20180924"].
The post that follows by Bruno Caram Muller and answered by Jimbou almost answer my question but not close enough to what I am looking for: How to plot data in R from different days overlayed in only one day (based on hours:minutes)?
head(eventos$fecha)
[1] 2018-09-27 13:32:45 2018-09-27 13:32:46 2018-09-27 13:32:48
[4] 2018-09-27 13:32:49 2018-09-27 13:32:54 2018-09-27 13:32:55
1407340 Levels: 2018-09-27 13:32:45 2018-09-27 13:32:46 ... 2019-02-26 13:33:34
head(eventos$velocidad)
[1] 2222 2222 2340 2340 2570 2570
I wish to have a code to simply plot one day on top of another where I can differentiate each day`s record.