From: Florian Frank Date: 2003-07-12T04:10:21+09:00 Subject: Re: cross-corr time/array lag problem On 2003-07-12 01:35:39 +0900, Qubert wrote: > Why is b not being set with a lag? I can not .collect because I need > to manupilate the index not the contents of the array. You could do this: b = [] a.each_index do |j| b << a[j - 1] end b would be right rotated by 1, because your first index -1 into a is the last element of a. b # => [5, 0, 1, 2, 3, 4] If you just want to skip the first element of a in b that would be a pretty short solution: b = a[1, a.size] -- To teach how to live with uncertainty, yet without being paralyzed by hesitation, is perhaps the chief thing that philosophy can do. -- Bertand Russell