Q:

Convert data frame to time series with 30 minutes interval

With
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"))

Is there a way to convert it to a time series format with 30-min interval?  Such like:
           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

As a matter of fact, there's more than one day's data and I'm just showing part of it.  Thanks! 

A:

library(plyr) 
library(reshape2)
x2 <- cbind(x, ldply(strsplit(x$time, " ")))[-2]
names(x2) <- c("value", "date", "time")
dcast(x2, date~time)

