Re: [R] Using diff, ifelse on zoo object

2009-10-13 Thread charliegenge
Thanks very much Gabor! Worked like a treat. Good to know that the na's really mess up the ifelse function. Thanks again. Gabor Grothendieck wrote: > > The problem is that ifelse does not work the way you might think (see > value section of ?ifelse) and basically should not be used with thre

Re: [R] Using diff, ifelse on zoo object

2009-10-12 Thread Gabor Grothendieck
The problem is that ifelse does not work the way you might think (see value section of ?ifelse) and basically should not be used with three zoo objects unless the three arguments to ifelse have the same time index. We can get that effect by using na.pad = TRUE in your diff call: TradedRate <-