[R] problem with indexing a zoo object

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Wed Nov 29 23:20:09 CET 2006


On Wed, 29 Nov 2006, Leeds, Mark (IED) wrote:

> My problem is the following : I create 2 zoo objects and then I try to
> subset one of them using logic. indicesthatpass is a vector of trues and

Nope, it's a matrix (because you want the coredata to be a matrix) but
should be a vector. (Maybe we could extend [.zoo here...)

> 2) even if the answer to 1) is yes, there could be some other way better
> than what I am doing ? It took me a while to even get to this point
> because I was taking is.infinite of fwdret and abs of bckret rather than
> their respective coredatas and that was really causing a mess because of
> the different indexing that was getting returned.

Logical comparisons on zoo objects return zoo objects as documented in
various places (which you should know about by now) including ?zoo and the
package vignette. The documentation suggests various strategies (including
using coredata).
Z



More information about the R-help mailing list