See also: selection from loop
Good afternoon Guys, i'm using R, i'm trying to build a function to extract the maximum from a range of 10 elements which varying with a loop iteration but i don't know how to.
This is roughly what i would like to obtain:
A <- $vector with 100 random numbers* for i in 1:length(A) maxx(i) = max (A[i]:A[i+9]) $ max of the range between A(i) and A(i+9) } maxx $list with length A, filled with all the maximums just calculated
thank you in advance,