Re: [R] selecting values that are unique, instead of selecting unique values

From: Gabor Grothendieck <>
Date: Wed, 25 Jun 2008 12:50:26 -0400

On Wed, Jun 25, 2008 at 12:19 PM, Daren Tan <> wrote:
> unique(c(1:10,1)) gives 1:10 (i.e. unique values), is there any method to get only 2:10 (i.e. values that are unique) ?

Try this:

setdiff(x, x[duplicated(x)]) mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 25 Jun 2008 - 17:01:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jun 2008 - 17:31:14 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive