[R-SIG-Finance] Omiting some observation of a zoo object

Gabor Grothendieck ggrothendieck at gmail.com
Wed Feb 16 16:12:16 CET 2011


On Wed, Feb 16, 2011 at 10:11 AM, Bogaso Christofer
<bogaso.christofer at gmail.com> wrote:
> Thanks Gabor for your solution. However I was expecting some more elegant
> solution that is based on the Indexing system like (0, negative etc) in R.
> Anyway I am happy with your solution.

zoo supports negative indexing in those situations that R does.  For
example, these work:

mySeries[-(7:9)]

z <- zoo(cbind(a = 1:3, b = 4:6))
subset(z, select = -b)

The xts package does have certain extended indexing facilities.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-SIG-Finance mailing list