Closed blongworth closed 5 months ago
The interval of your example data is is second and on this interval there is no observation missing from the data. pad
does work for the following example
now <- as.POSIXct("2024-03-01 00:00:03")
x <- data.frame(time = seq(now, as.POSIXct("2024-03-01 00:00:06"), by = "sec"), value = 1:4)
y <- x[-3,]
pad(y)
Thicken does not work because you need to specify a character for the interval, in the example you give a numeric. Moreover, applying thicken
to this data has no use because it is already at the lowest interval supported by padr
(the second).
The seq()
call from my example produces a sequence from 2024-03-01 00:00:00.00 to 2024-03-01 00:00:01, with five elements 1/4 s apart.
seq(now, now + 1, 1/4)
I was hoping I was missing a way that padr
could work with arbitrary intervals, like the 1/4
passed to seq()
instead of "sec", "hour"
, etc.
It sounds like the answer is that padr
only supports intervals 1 second or greater.
Yes that conlusion is correct
I have a dataset recorded at 16Hz with missing rows (gap in timestamps). Can padr be used to pad this to a regular timeseries? This doesn't work:
Created on 2024-03-20 with reprex v2.1.0
There are no ascii
by
arguments toseq.POSIXt()
smaller than second, but supplying a number works for creating sub-second sequences (see above data generation).