Hi Mitch, How about identical()?
> identical(c(1,2,3), c(1,2,5)) [1] FALSE > identical(c(1,2,3), c(1,2,3)) [1] TRUE See ?identical and ?all.equal for more information. HTH, Jorge On Fri, Aug 13, 2010 at 2:49 PM, Downey, Patrick <> wrote: > Hello, > > Is there a way to get a single TRUE or FALSE statement from comparing two > vectors? For example, > c(1,2,3) == c(1,2,3) > produces > TRUE TRUE TRUE > > where I would like it to produce only > TRUE > for use in an if statement. > > Likewise, when two vectors are not exactly identical (in all elements) I > would like a single FALSE result, as opposed to > c(1,2,3) == c(1,2,5) > TRUE TRUE FALSE > > Any ideas? > > Thanks, > Mitch > > ______________________________________________ > R-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.