Preserve xts index when using rowSums on xts

Viewed 923

Is there a way to preserve the index of an xts object when passing rowSums a xts object?

Currently I recast the result as an xts object, but this doesn't seem to be as fast as it could be if rowSums was able to simply return what it was passed.

xts(rowSums(abs(data)),index(data))
2 Answers
Related