s-news
[Top] [All Lists]

Re: simple function

To: "Leeds, Mark" <mleeds@mlp.com>, <s-news@lists.biostat.wustl.edu>
Subject: Re: simple function
From: "Potgieter, Andries B" <Andries.Potgieter@dpi.qld.gov.au>
Date: Tue, 14 Jun 2005 15:56:45 +1000
Cc: <cspark@ces.clemson.edu>
Importance: normal
Thread-index: AcVvAY9f8+Cl6QAPR6yuO/Tmgsd7fwBpD7VA
Thread-topic: simple function
try
 
t
 AAA BBB AAA CCC BBB
   3   4   3   2   4
> unique(names(t))
[1] "AAA" "BBB" "CCC"
-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Leeds, Mark
Sent: Sunday, 12 June 2005 1:48 PM
To: s-news@lists.biostat.wustl.edu
Cc: cspark@ces.clemson.edu
Subject: [S] simple function

I have a vector that

Has names

 

So it might be

 

AAA   BBB     AAA  CCC        BBB

 3         4          3        2            4

 

so I want a function that  returns as

below ( just the unique names ).

 

AAA      BBB     CCCC

 

 3            4            2

 

also, if it has the same name it will

always have the same #  so

the case of same name with different

number doesn’t have to be dealt with.

 

 

                                    thanks

********************************DISCLAIMER****************************
The information contained in the above e-mail message or messages 
(which includes any attachments) is confidential and may be legally 
privileged.  It is intended only for the use of the person or entity 
to which it is addressed.  If you are not the addressee any form of 
disclosure, copying, modification, distribution or any action taken 
or omitted in reliance on the information is unauthorised.  Opinions 
contained in the message(s) do not necessarily reflect the opinions 
of the Queensland Government and its authorities.  If you received 
this communication in error, please notify the sender immediately and 
delete it from your computer system network.
<Prev in Thread] Current Thread [Next in Thread>