This is great all.

It works perfectly. Thank-you.

Cheers,
Jesse

On Wed, Jan 13, 2010 at 14:27, Adrian Dusa <dusa.adrian@gmail.com> wrote:

> Hi Jesse,
>
> If your vector is called "aa", then how about:
>
> > table(aa)
> aa
>  spp1 spp10  spp2  spp3  spp4  spp5  spp6  spp7  spp8  spp9
>    7     2    16     8    15     9     9    10     9    15
>
> Hope this helps,
> Adrian
>
>
> On Thursday 14 January 2010, Jesse Sinclair wrote:
> > Hi all,
> >
> > I have a vector of strings and need to count the number of times a string
> > appears in the vector.
> >
> > eg:
> >
> >  [1] spp6  spp10 spp6  spp6  spp4  spp2  spp9  spp10 spp5  spp2  spp2
>  spp3
> >  [13] spp4  spp3  spp6  spp10 spp6  spp4  spp9  spp3  spp6  spp1  spp10
> >  spp8
> >
> >  [25] spp2  spp10 spp9  spp7  spp1  spp3  spp8  spp6  spp3  spp8  spp6
> >  spp5
> >
> >  [37] spp5  spp9  spp3  spp1  spp4  spp5  spp9  spp3  spp3  spp5  spp4
> >  spp9
> >
> >  [49] spp3  spp7  spp7  spp2  spp6  spp5  spp7  spp4  spp8  spp9  spp2
> >  spp6
> >
> >  [61] spp3  spp3  spp2  spp6  spp3  spp5  spp6  spp6  spp4  spp1  spp1
> >  spp1
> >
> >  [73] spp10 spp8  spp1  spp6  spp1  spp5  spp8  spp9  spp5  spp6  spp9
> > spp10
> >  [85] spp2  spp6  spp10 spp1  spp2  spp3  spp5  spp8  spp2  spp7  spp4
> >  spp7
> >
> >  [97] spp2  spp6  spp2  spp6
> >
> > Is it possible to create a vector of counts for each spp1-spp10?
> >
> > Any help or ideas would be appreciated.
> >
> > Cheers,
> > Jesse
> >
> >       [[alternative HTML version deleted]]
> >
>
>
> --
> Adrian Dusa
> Romanian Social Data Archive
> 1, Schitu Magureanu Bd.
> 050025 Bucharest sector 5
> Romania
> Tel.:+40 21 3126618 \
>     +40 21 3120210 / int.101
> Fax: +40 21 3158391
>

	[[alternative HTML version deleted]]

