[6251] in s-news-athena

home help back first fref pref prev next nref lref last post

counting replicated X

daemon@ATHENA.MIT.EDU (Bill Shipley)
Tue Jan 24 14:33:08 1995

Date: Tue, 24 Jan 1995 13:33:44 -0500
To: S-news@utstat.toronto.edu
From: bshipley@courrier.usherb.ca (Bill Shipley)

Here is a (probably) simple problem which I want to solve without using
"for" loops:
given a vector: x<-c(1,1,1,2,2,3,4,4)
I want to count the number of replicate values of each unique value in x.
I.e. I want something like:
unique x: 1 2 3 4
# reps  :  3  2 1 2.

Any ideas?
Bill Shipley
Departement de Biologie
Universite de Sherbrooke
Sherbrooke (Quebec)
CANADA J1K 2R1
bshipley@courrier.USherb.ca


home help back first fref pref prev next nref lref last post