Skip to content
Prev 300678 / 398506 Next

Truncating (rounding down) to nearest half hour.

My amateur approach:

I put your data in a dataframe called t:
Date Score
1 2008-05-01 08:58:00    80
2 2008-05-01 13:31:00    11
3 2008-05-01 16:35:00    81
4 2008-05-01 23:20:00   152
5 2008-05-02 01:01:00   130
6 2008-05-02 03:35:00   122

Then I created a vector with rounded down minutes:
[1] "30" "30" "30" "00" "00" "30"

Next the replacement:
Date Score
1 2008-05-01 08:30:00    80
2 2008-05-01 13:30:00    11
3 2008-05-01 16:30:00    81
4 2008-05-01 23:00:00   152
5 2008-05-02 01:00:00   130
6 2008-05-02 03:30:00   122

Is that what you were looking for?

Rgds,
Rainer



-------- Original-Nachricht --------