counting duplicates

Bruce McCullough (
Wed, 14 Jan 1998 15:26:21 -0500

I have a character vector of 9000 names.

Some names appear more than once, as
many as thirty times.

I wish to create an associated numeric vector, also
of length 9000 which indicates, for each name, the
number of times the name appears in the list.

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

duplicate, match, and unique don't seem to help.

A "for" loop would work, but I'm trying to avoid that.

Please reply to me personally. I will post a
summary to the list.

Many thanks,