s-news
[Top] [All Lists]

Re: Extracting vector elements

To: Yong Wang <wang@galton.uchicago.edu>
Subject: Re: Extracting vector elements
From: "Petr Pikal" <petr.pikal@precheza.cz>
Date: Fri, 11 Jun 2004 09:14:47 +0200
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <Pine.LNX.4.58.0406110131570.11921@aitken.uchicago.edu>
References: <40C73F64.8030904@pdf.com>
Hi

On 11 Jun 2004 at 1:37, Yong Wang wrote:

> 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

Did you tried "table()" as Spencer suggested and did you look at the result? If 
yes, and the result does not suite your purpose can you give an example what 
you 
would like to achieve?

Cheers
Petr


> 
> 
> 
> 
> 
> 
> 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
> > 
> --------------------------------------------------------------------
> 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

Petr Pikal
petr.pikal@precheza.cz



<Prev in Thread] Current Thread [Next in Thread>