[R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
Dear fellow R users, I am replacing elements of a list like so: pulse_subset[[1:20]]=unlist(pulse[i])[1:20] where pulse is a list of lists, and pulse [i] has 20 values. This gives the error Recursive Indexing failed at level 2. But, interestingly this instruction is part of a loop which has

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Duncan Murdoch
On 26/06/2010 7:53 AM, Jim Hargreaves wrote: Dear fellow R users, I am replacing elements of a list like so: pulse_subset[[1:20]]=unlist(pulse[i])[1:20] If pulse is a list, then pulse[i] is also a list, with one element. I think you want pulse[[i]], which extracts element i. If

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
On 06/26/2010 01:20 PM, Duncan Murdoch wrote: On 26/06/2010 7:53 AM, Jim Hargreaves wrote: Dear fellow R users, I am replacing elements of a list like so: pulse_subset[[1:20]]=unlist(pulse[i])[1:20] If pulse is a list, then pulse[i] is also a list, with one element. I think you want

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Duncan Murdoch
On 26/06/2010 8:29 AM, Jim Hargreaves wrote: On 06/26/2010 01:20 PM, Duncan Murdoch wrote: On 26/06/2010 7:53 AM, Jim Hargreaves wrote: Dear fellow R users, I am replacing elements of a list like so: pulse_subset[[1:20]]=unlist(pulse[i])[1:20] If pulse is a list, then pulse[i]

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
Hi Duncan, list, Thanks for the advice, but unfortunately that wasn't what was causing my problem. I'm still getting the Recursive indexing failed at level 2 message even after replacing my unlist(pulse[i]) with pulse[[i]]. Error:

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Duncan Murdoch
Jim Hargreaves wrote: Hi Duncan, list, Thanks for the advice, but unfortunately that wasn't what was causing my problem. I'm still getting the Recursive indexing failed at level 2 message even after replacing my unlist(pulse[i]) with pulse[[i]]. Read the second part of my first message,

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Jim Hargreaves
On 06/26/2010 02:07 PM, Duncan Murdoch wrote: Jim Hargreaves wrote: Hi Duncan, list, Thanks for the advice, but unfortunately that wasn't what was causing my problem. I'm still getting the Recursive indexing failed at level 2 message even after replacing my unlist(pulse[i]) with pulse[[i]].

Re: [R] Recursive indexing failed at level 2

2010-06-26 Thread Bill.Venables
. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Hargreaves Sent: Saturday, 26 June 2010 9:54 PM To: r-help@r-project.org Subject: [R] Recursive indexing failed at level 2 Dear fellow R users, I am replacing elements of a list like so