[R] Select only unique rows from a data frame

Bert Gunter gunter.berton at gene.com
Thu Feb 7 22:06:14 CET 2013


?unique

Please learn to search for yourself, e.g. via:
??unique

or the tons of other ways.

-- Bert

On Thu, Feb 7, 2013 at 12:50 PM, Dimitri Liakhovitski
<dimitri.liakhovitski at gmail.com> wrote:
> Hello!
>
> I have a data frame with several rows, for example:
>
> x=as.data.frame(matrix(c(1,2,3,
>        1,2,3,
>        1,2,2,
>        1,2,2,
>        1,1,1),ncol=3,byrow=T))
> I would like to find y - a data frame that only has the unique rows from x,
> i.e.:
> 1,2,3
> 1,2,2
> 1,1,1
>
> Thanks a lot for your hints!
> Dimitri
>
> --
> Dimitri Liakhovitski
> gfk.com <http://marketfusionanalytics.com/>
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list