[R] how to find unique pairs of variables?
David Winsemius
dwinsemius at comcast.net
Thu Sep 15 18:41:03 CEST 2011
On Sep 15, 2011, at 12:27 PM, bby2103 at columbia.edu wrote:
> I have two variables, both numerical. I would like to find the
> unique values of the pairs, in other words, unique coordinates if I
> were to plot them.
>
> I also need to know how many pairs there are, but I guess I can use
> length() if I can somehow isolate the unique pairs first?
?duplicated
dfrm[ !duplicated(dfrm), ]
# Would give the unique pairs.
--
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list