[R] Recursive indexing failed at level 2

From: Jim Hargreaves <james_at_ipec.co.uk>
Date: Sat, 26 Jun 2010 12:53:45 +0100


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 gone through about 200,000 iterations before giving this error.

Actual code:
>

pulse_subset[[1:(length(unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])]))]] <- unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])]

Error in
pulse_subset[[1:(length(unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])]))]] <- unlist(pulse[i])[as.numeric(peak_start[i]):as.numeric(peak_end[i])] :

   recursive indexing failed at level 2

If anyone could shed some light I'd be rather grateful.

Regards,
Jim Hargreaves



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 26 Jun 2010 - 11:56:54 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 Jun 2010 - 03:00:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive