sorry.. don't know unique().. such a great function
From: Bert Gunter
Cc: "r-help@r-project.org"
Sent: Tuesday, January 28, 2014 2:21 PM
Subject: Re: [R] unique rows
Inline.
-- Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650)
Hi,
use ?unique
unique(dat)
A.K.
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'))
> dat
x y
[1,] "a" "x"
[2,] "a" "x"
[3,] "b" "d"
[4,] "
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 wrote:
> Hi, I wanted to remove redundant rows (with sa
Hi Ralf,
Perhaps the following is what you are looking for:
d <- data.frame(timestamp=c(3,3,3,5,8), mylabel=c("a","a","a","b","c"))
d
d[!duplicated(d$timestamp),]
HTH,
Jorge
On Fri, Jul 30, 2010 at 12:18 AM, Ralf B <> wrote:
> I have to deal with data frames that contain multiple entries of t
Try this:
> DF[!duplicated(DF$x1), ]
x1 x2
1 A 1
2 B 2
> # or
> subset(DF, !duplicated(x1))
x1 x2
1 A 1
2 B 2
On 10/2/07, Dieter Best <[EMAIL PROTECTED]> wrote:
> Hello there,
>
> I have a data frame a small version of which could look like the following:
>
>x1 x2
> 1 A 1
> 2
Hi guys,
thanks for all your help. I didn't know about aggregate yet.
John Kane <[EMAIL PROTECTED]> wrote:
?aggregate
x <- data.frame(a= as.factor(c("A", "B" , "B" ,"C"
,"B", "A", "D")),
b = c(3, 2, 1, 1, 2, 3, 7))
aggregate(x[,2], list(x[,1]), mean)
--- Dieter Best wrote:
> Hello
?aggregate
x <- data.frame(a= as.factor(c("A", "B" , "B" ,"C"
,"B", "A", "D")),
b = c(3,2,1, 1, 2,3, 7))
aggregate(x[,2], list(x[,1]), mean)
--- Dieter Best <[EMAIL PROTECTED]> wrote:
> Hello there,
>
> I have a data frame a small version of which could
> look like th
Here is one way to get the means:
> x
x1 x2
1 A 1
2 B 2
3 B 3
> aggregate(x$x2, list(x$x1),mean)
Group.1 x
1 A 1.0
2 B 2.5
>
On 10/2/07, Dieter Best <[EMAIL PROTECTED]> wrote:
> Hello there,
>
> I have a data frame a small version of which could look like the following:
8 matches
Mail list logo