unique(x, incomparables = F) duplicated(x, incomparables = F)
duplicated returns a logical vector the same length as x that tells for each element of x whether that value has appeared before in x.
The duplicated function is generic and hence unique is effectively generic since it is based on duplicated (and [). Currently there are no methods for duplicated.
sort(unique(names)) # sorted list of names with no duplicatesunique(x[duplicated(x)]) # values that occur at least twice
unique(x, incomp=c(1/0,-1/0)) # make infinities non-unique