和
x <- data.frame(value = round(rt(20, 2), 2),
time = c("2012-09-03 00:00:00", "2012-09-03 00:30:00",
"2012-09-03 01:00:00", "2012-09-03 01:30:00",
"2012-09-03 02:00:00", "2012-09-03 02:30:00",
"2012-09-03 03:00:00", "2012-09-03 03:30:00",
"2012-09-03 04:00:00", "2012-09-03 04:30:00",
"2012-09-03 05:00:00", "2012-09-03 05:30:00",
"2012-09-03 06:00:00", "2012-09-03 06:30:00",
"2012-09-03 07:00:00", "2012-09-03 07:30:00",
"2012-09-03 08:00:00", "2012-09-03 08:30:00",
"2012-09-03 09:00:00", "2012-09-03 09:30:00"))
有没有办法将其转换为间隔 30 分钟的时间序列格式?比如:
00:00:00 00:30:00 01:00:00 01:30:00 02:00:00 02:30:00 ...
2012-09-03 0.31 -1.01 0.94 -0.75 -0.40 0.41
事实上,有不止一天的数据,我只是展示其中的一部分。谢谢!