On Tue, 2006-03-14 at 18:45 +0100, Arnau Mir wrote:
> Hello.
>
> I have a vector of length 2771 but it has only 87 different values.
> How can I obtain them?
>
> Thanks,
>
> Arnau.
If you just want the unique values themselves, you can use:
unique(vector)
For example:
> v
[1] "b" "b" "c" "a" "a" "a" "c" "c" "c" "c"
> unique(v)
[1] "b" "c" "a"
If you wanted counts of each unique value, you can use table():
> table(v)
v
a b c
3 2 5
HTH,
Marc Schwartz
______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html