[R] A question on Duplicating

Ravi Varadhan rvaradhan at jhmi.edu
Wed Feb 9 16:20:05 CET 2011


?duplicated

This will identify common locations where duplications occur:

duplicated(a) & duplicated(b)

Ravi.

-------------------------------------------------------
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Nipesh Bajaj
Sent: Wednesday, February 09, 2011 10:12 AM
To: r-help at r-project.org
Subject: [R] A question on Duplicating

Hello I am struggling to accomplice an idea which is as follows:

I have a vector say: a <- c("a", "b", "c", "a") and another: b <- c("m",
"n", "o", "m"). Length of those 2 vectors are essentially be same. Here task
is to check the duplicates in the vector 'a' and then to check whether any
duplicates are there in the same places of 'b'. If not, flag a FALSE.

I above example, it is correct hence TRUE. However in general how can I
implement this?

Can somebody please help me?

Thanks,

	[[alternative HTML version deleted]]

______________________________________________
R-help at r-project.org mailing list
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.



More information about the R-help mailing list