Hello *,

I'm trying to round time stamps, consisting of a date and time part, to 10
minutes intervals
The timestamps have the following format: %d.%m.%Y %H:%M

*timeStamp <- c("31.03.2011 09:30", "31.03.2011 09:41", "31.03.2011 10:04",
"31.03.2011 10:10", "31.03.2011 10:28", "31.03.2011 10:35", "31.03.2011
10:49", "31.03.2011 23:59")*

should look like this:
*timeStamp2 <- c("31.03.2011 09:30", "31.03.2011 09:40", "31.03.2011
10:00", "31.03.2011 10:10", "31.03.2011 10:30", "31.03.2011 10:40",
"31.03.2011 10:55", "01.04.2011 00:00")*

I've found this topic on the web:
http://stats.stackexchange.com/questions/5305/how-to-re-sample-an-xts-time-series-in-r

library(xts)
align.time(as.POSIXct(timeStamp, format="%d.%m.%Y %H:%M"), 10 * 60)

which uses the align.time function from the library xts BUT as far as I can
see only supports either all timestamps being either  rounded up or down
(not both, depending on the minutes 0-9 being either > or < 5 line the way
I need it)

As I'm really struggling with this topic, any help and hint is  awarded
with greatest thankfulness from my sideĀ…

Best regards, Katharina

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to