I have a matrix of lists.  Something along the lists of (but much
bigger than):

  x = array(dim=c(2, 2), data=list())
  x[1,1] = list(1:5)
  x[2,1] = list(6:9)
  x[1,2] = list(10:13)
  x[2,2] = list(14:16)

Each list contains a number of observations/ground truth for a
particular state.  That is, state <1,1> has observations <1,2,3,4,5>.
States may have a different number of observations (which is why I'm
not using an array).

I have another numeric matrix with the same dimensions and I want to
check if its values occur.  Something along the lines of:

 y = array(dim=c(2, 2), data=c(1, 10, 11, 20))

I want to do:

 y %in% x

But it doesn't work as hoped.  (I expect: c(T, F, T, F).)

I realize that I can do this with sapply, but I was hoping for a
faster / smarter solution.  Any ideas?

Thanks!

:) Neal

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to