Re: [R] Extracting only the non-repeated rows of matrices

2009-07-06 Thread Henrique Dallazuanna
Try this: subset(merge(as.data.frame(A), cbind(as.data.frame(B), ID=1), all = T), is.na(ID), select = -ID) On Mon, Jul 6, 2009 at 8:39 AM, dreamworx wrote: > > I have 2 matrices. One which contains a complete set of row combinations. > Another which contains a subset of the first. W

Re: [R] Extracting only the non-repeated rows of matrices

2009-07-06 Thread jim holtman
Here is one way of doing it: > set.seed(1) > a <- matrix(sample(1:2, 10, TRUE), ncol=2) > b <- matrix(sample(1:2, 4, TRUE), ncol=2) > a [,1] [,2] [1,]12 [2,]12 [3,]22 [4,]22 [5,]11 > b [,1] [,2] [1,]12 [2,]11 > # create a vector of

[R] Extracting only the non-repeated rows of matrices

2009-07-06 Thread dreamworx
I have 2 matrices. One which contains a complete set of row combinations. Another which contains a subset of the first. What I would like to extract is the rows which are in the first but not repeated in the second. For instance if the following were my two matrices, A [,1] [,2] [,3] [,4]