Skip to content

matrix merge problem

2 messages · Juan Pablo Fededa, Luc Villandre

#
Hi Juan,

Your first question can be answered easily.

bin.matrix = matrix(A %in% B,nrow(A),ncol(A)) ;
bin.vector = rowSums(bin.matrix) > 0 ;
C = A[bin.vector,] ;

This should do the trick.

Cheers,

Luc
Juan Pablo Fededa wrote: