Skip to content
Prev 66993 / 398528 Next

coalesce in its

On Mon, 4 Apr 2005 13:46:46 -0400 Omar Lakkis wrote:

            
If I understand you correctly, you want:

R> ts3 <- union(ts1, ts2)
R> repIndex <- is.na(ts3[,1])
R> ts3[repIndex, 1] <- ts3[repIndex, 2]
R> ts3[,1]
            settle
2000-09-25 107.610
2000-09-26 107.585
2000-09-27 107.385
2000-09-28 107.595
2000-09-29 107.830
2000-10-02 108.210
2000-10-03 108.800
2000-10-04 108.800
2000-10-05 109.155

hth,
Z