I'm trying to extract pure unique values in R.
For example:
vec <- c("a", "b", "c","c")
Using duplicate()
I get:
vec[!duplicated(vec, fromLast=TRUE)]
[1] "a" "b" "c"
But I want the pure unique values, so only "a"
and "b"
.
Using unique()
I get the same output.
Anyone know how to solve this?