[R] jagged array

Tolga Uzuner tolga at coubros.com
Sun Jul 3 01:41:05 CEST 2005


Hi,

I have a "jagged array" which looks like this:

 > res
...
[[996]]
[1] 1.375 3.375 4.125 4.625 4.875 4.875 6.625 7.125 8.875

[[997]]
[1] 1.875 5.125 6.875 7.875 9.875

[[998]]
[1] 1.875 5.375 6.625 6.875 8.125 9.375 9.625

[[999]]
[1] 1.875 6.875 9.875

[[1000]]
[1] 1.875 6.125 6.875 9.375 9.625


Now, I want to use the first row,so I say res[1]

 > res[1]
[[1]]
 [1] 3.125 4.375 4.625 5.125 5.375 6.375 6.875 7.875 9.125 9.125 9.375 9.375

How do I access, an element within this ? I try

 > res[1][1]
[[1]]
 [1] 3.125 4.375 4.625 5.125 5.375 6.375 6.875 7.875 9.125 9.125 9.375 9.375

which returns the same vector.. ??? How do I "get to" 3.125 ?

Thanks




More information about the R-help mailing list