< I want to exclude from A the elements contained in B.>
A[!(A%in%B)]  may do what you want.

?"%in%" or ?match

!= will do a pairwise comparison.

Bob


-----Original Message-----
From: Yao, Minghua [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 11, 2003 3:17 PM
To: R Help (E-mail)
Subject: [R] Excluding from an Array the Elements of Another Array 

Hi,

My question goes like this. I have two arrays A and B. I want to exclude
from A the elements contained in B.
Is there an easy way like A[A != x] to exclude a single one. Thanks for any
help.

Regards,

-MY

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to