How can I list the distinct values in a vector where the values are replicative? I mean, similarly to the following SQL statement:
SELECT DISTINCT product_code
FROM data
Do you mean unique
:
R> x = c(1,1,2,3,4,4,4)
R> x
[1] 1 1 2 3 4 4 4
R> unique(x)
[1] 1 2 3 4