How to use loop in R to average only the negative number up until you see a number with absolute value>1 in a vector?

前端 未结 0 1433
时光说笑
时光说笑 2021-02-14 13:01

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?

相关标签:
回答
  • 消灭零回复
提交回复
热议问题