First of all, thanks for submitting a complete and reproducible example.
Secondly, I like your decision. It may be difficult for you to make it much faster, but at the same time it is simple. One solution is to work jst on the base matrix (and not the zoo object):
> X <- coredata(x) > t(apply(X, 1, rank)) abc [1,] 1 3 2 [2,] 1 2 3 [3,] 1 2 3 >
and then reattach the time index. It can be faster, but not necessarily more protective or easier to read.
source share