Yao, Minghua
2003-Dec-11 20:17 UTC
[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
RBaskin@ahrq.gov
2003-Dec-11 20:58 UTC
[R] Excluding from an Array the Elements of Another Array
< 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:myao@ou.edu] 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 ______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help [[alternative HTML version deleted]]