[R] strange split behavior?

Peng Yu pengyu.ut at gmail.com
Wed Sep 23 05:41:25 CEST 2009


Hi,

Please see the command with a comment below. I don't find
'A630039F22Rik' in y. But 'A630039F22Rik' is in z. Can somebody let me
know what the problem is?

Regards,
Peng

> str(x)
 int [1:365494] 6 7 8 14 15 18 19 21 25 29 ...
> str(y)
 Factor w/ 29904 levels "0610005C13Rik",..: 17261 28617 15927 15462
8988 23500 16577 20250 27911 13981 ...
> z=split(x,y)
> str(z[5529])
List of 1
 $ A630039F22Rik: int(0)
> which(y=='A630039F22Rik')#it is weird
integer(0)
> str(z[1])
List of 1
 $ 0610005C13Rik: int [1:5] 592506 735015 958481 979622 1124670
> which(y=='0610005C13Rik')
[1] 181073 224717 292981 299543 343964
>




More information about the R-help mailing list