Skip to content
Prev 316006 / 398513 Next

setting off-diagonals to zero

On 24-01-2013, at 01:58, emorway <emorway at usgs.gov> wrote:

            
You misread. I did not say anything about 'i'.
Well then look at this

for (i in 731:732) {
 SEQ <- (i - 5):(i + 5)
 print(SEQ)
 SEQ <- SEQ[SEQ > 730 & SEQ < 1096]
 print(SEQ)
 print((731:1095)[-(-730+SEQ)])  # my modification
}

# [1] 726 727 728 729 730 731 732 733 734 735 736
# [1] 731 732 733 734 735 736
# [1]  737  738  739  740  741  742  743  744  745  746  747  748  749  750  751

which seems to give the desired output