[R] unique rows

Bert Gunter
Tue, 28 Jan 2014 22:21:47 -0000

Inline.

-- Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
H. Gilbert Welch




On Tue, Jan 28, 2014 at 2:06 PM, array chip <arrayprofile at yahoo.com>
wrote:
> Hi, I wanted to remove redundant rows (with same entry in columns) in a
data frame. For example, with this data frame:
>
>>
dat<-cbind(x=c('a','a','b','b','c','c'),y=c('x','x','d','s','g','g'))

## this is not a data frame.

And would you kindly explain why you posted here instead of reading ?unique.

-- Bert

>> dat
>      x   y
> [1,] "a" "x"
> [2,] "a" "x"
> [3,] "b" "d"
> [4,] "b" "s"
> [5,] "c" "g"
> [6,] "c" "g"
>
> after removing the redundancy, the end results should be
>
>      x   y
> [1,] "a" "x"
> [2,] "b" "d"
> [3,] "b" "s"
> [4,] "c" "g"
>
> what is the best way to do this?
>
> Thanks
>
> John
>         [[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.
>