Two hourly time series xts1 and xts2, xts1 has some missing times.
xts1
time speed power
2010-01-01 00:00:00 0.1 1.1
2010-01-01 01:00:00 0.2 1.2
2010-01-01 05:00:00 0.2 1.2
.....
xts2
time speed power
2010-01-01 00:00:00 0.1 1.1
2010-01-01 01:00:00 0.2 1.2
2010-01-01 02:00:00 0.2 1.2
.....
When combine them into one file(get the average of speed, and sum the power based on the same timestamp), get non--conformable arrays error. The command used was:
hourly.data.table = data.table (time = time(xts1), meanspeed= (coredata(xts1$speed)+coredata(xts2$speed))/2, power= coredata(xts1$power)+coredata(xts2$power))
How to do this combination by time? Thanks in advance.
Try
data