s-news
[Top] [All Lists]

Re: Extracting vector elements

To: Spencer Graves <spencer.graves@pdf.com>
Subject: Re: Extracting vector elements
From: Yong Wang <wang@galton.uchicago.edu>
Date: Fri, 11 Jun 2004 01:37:01 -0500 (CDT)
Cc: Jonathan Dakin <jd@johndakin.demon.co.uk>, Splus Posting <s-news@lists.biostat.wustl.edu>
In-reply-to: <40C73F64.8030904@pdf.com>
References: <000001c44e3f$a0e2a290$0100000a@desktop> <40C73F64.8030904@pdf.com>
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
> 

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