Suppose I have a vector A=c(0.866,-0.142,-0.680,1.600,-1.068)
How can I use loop to average only the negative numbers up until the first number with absolute value >1?