[R] How do I tell whether two vectors are identical?

Bert Gunter gunter.berton at gene.com
Tue Oct 12 19:43:45 CEST 2010


Try preusing an Intro to R for such elementary questions, please. Also
the R Help facility.

But...

?identical   ##(oddly enough...)
?"=="

But beware numerical issues -- see R FAQ 7.31.

-- Bert


On Tue, Oct 12, 2010 at 10:35 AM, ANJAN PURKAYASTHA
<anjan.purkayastha at gmail.com> wrote:
> Hi,
> I have two vectors, each of length 45000.
> How do I compare the vectors to ascertain if they are identical. Secondly if
> they are NOT identical, how do I determine the indices of positions at which
> the vectors differ?
> Thanks,
> Anjan
>
>
> --
> ===================================
> anjan purkayastha, phd.
> research associate
> fas center for systems biology,
> harvard university
> 52 oxford street
> cambridge ma 02138
> phone-703.740.6939
> ===================================
>
>        [[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.
>



-- 
Bert Gunter
Genentech Nonclinical Biostatistics



More information about the R-help mailing list