Re: counting duplicates

Alan Zaslavsky (zaslavsk@hcp.med.harvard.edu)
Thu, 15 Jan 1998 07:37:25 -0500 (EST)


> If "John Smith" appears 30 times,
> then for each occurrence of "John Smith"
> the associated numeric vector should
> assume the value 30.

If X is your character vector, try

table(X)[X]