bco.com
>
> *From:* zhenjiang xu [mailto:zhenjiang...@gmail.com]
> *Sent:* Wednesday, September 07, 2011 8:04 PM
>
> *To:* William Dunlap
> *Cc:* r-help
> *Subject:* Re: [R] counting the duplicates in an object of list
>
> ** **
>
> I tried converting th
ill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
From: zhenjiang xu [mailto:zhenjiang...@gmail.com]
Sent: Wednesday, September 07, 2011 8:04 PM
To: William Dunlap
Cc: r-help
Subject: Re: [R] counting the duplicates in an object of list
I tried converting the elements to strings before, but due to
gt; wdunlap tibco.com
>
> *From:* zhenjiang xu [mailto:zhenjiang...@gmail.com]
> *Sent:* Wednesday, September 07, 2011 7:25 PM
> *To:* William Dunlap
> *Cc:* r-help
> *Subject:* Re: [R] counting the duplicates in an object of list
>
> ** **
>
> Now I naile
2011 7:25 PM
To: William Dunlap
Cc: r-help
Subject: Re: [R] counting the duplicates in an object of list
Now I nailed down the problem, but I am still confused why match() takes the
1st two components and the last two the same.
> match(a,a)
[1] 1 2 3 1 2
> a
[[1]]
[1] "YARCTy1-1" &q
Now I nailed down the problem, but I am still confused why match() takes the
1st two components and the last two the same.
> match(a,a)
[1] 1 2 3 1 2
> a
[[1]]
[1] "YARCTy1-1" "YAR009C" "YBLWTy1-1" "YBL005W-B" "YBRWTy1-2" "YBR012W-B"
[7] "YDRCTy1-1" "YDR098C-B" "YDRCTy1-2" "YDR210C-D" "YDRCTy
Thanks, Bill. match() is nice and efficient. However, I met a problem:
My real data is a large _list_ named "read.genes". I found conflict results
between match() and unique() - the lengths of the outcomes are different
(and my final result are wrong too). I suspect that some different list
compon
table(match(x, x)) gives you the numbers but the labels are
a bit more work.
E.g., I'll define another list
> x <- list(c("1", "2", "4"), c("1", "2", "4"), 2^(0:4), 3^(1:2), 2^(0:4))
> tb <- table(m <- match(x, x))
> m
[1] 1 1 3 4 3
> tb
1 3 4
2 2 1
which says that the first elem
7 matches
Mail list logo