Dear all
I have a quick question follow Jonathan's(as below)
If I wanna have not only the unique elements in an array but also the
frequency of each unique elements in the original array, what's the most
effcient way to get a quick summary list of such frequency corresponding
to each unique elements?
many thanks
yong
On Wed, 9 Jun 2004, Spencer Graves wrote:
> ?unique or ?table
>
> hope this helps. spencer graves
>
> Jonathan Dakin wrote:
>
> > Dear S users,
> >
> > Is there a simple way of reducing a vector to one in which each
> > element is expressed once, no matter how many occurences there are in
> > the original ?
> >
> > Eg :
> >
> > 1,2,2,3,3,3,3,3,4 ----> 1,2,3,4
> >
> > I have been using such convoluted means as the intersection with the
> > set of integers, or reducing to factor data and then re-converting.
> > Clearly there is something I'm missing. Many thanks.
> >
> > Jonathan Dakin
> > Imperial College London
> >
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
|