unique(): see its help page.  (It has a data-frame method.)

On Wed, 9 Nov 2005, Bruno Cutayar wrote:

>
>
> Hello,
> with a data.frame like this :
> > toto <-
> data.frame(id=c("id1","id1","id2","id3","id3","id3"),dpt=c("13","13","34","30","30","30"))
> > toto
>   id dpt
> 1 id1  13
> 2 id1  13
> 3 id2  34
> 4 id3  30
> 5 id3  30
> 6 id3  30
>
> what is the most efficient ways to obtain :
>   id dpt
> 1 id1  13
> 2 id2  34
> 3 id3  30
> ?
> thanks in advance for your reply
> Bruno

-- 
Brian D. Ripley,                  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to