[R] jagged array

From: Tolga Uzuner <tolga_at_coubros.com>
Date: Sun 03 Jul 2005 - 09:41:05 EST


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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 03 09:53:54 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:11 EST