0

Two hourly xts have below format, but xts1 has some missing times.

time                   speed power
2010-01-01 00:00:00     0.1  1.1
2010-01-01 01:00:00     0.2  1.2
.....

When combine them into one file(get the average of speed, and sum the power based on time), 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))

Thanks in advance.

user1047
  • 169
  • 1
  • 3
  • 9
  • It doesn't look like you're merging anything to me. You're explicitly calling `coredata` which avoids the merge that `Ops.xts` would do when adding two xts objects. That's probably why you're getting an error, but it's hard to say without a [reproducible example](http://stackoverflow.com/q/5963269/271616). – Joshua Ulrich Apr 20 '15 at 22:20
  • Thanks for the comment. It's to get the mean of speeds and the sum of power of two time series by time. As some rows are missing in either one of the two xts, I don't know the exact command to perform this task. – user1047 Apr 20 '15 at 22:26

0 Answers0