title: R: Create a while loop to sum values below mean in a vector
body: <p>I could really use some help here, I want a while loop which will calculate the sum of all values below mean in a vector,  I also want to extract the amount of values within the sum,  the vector looks like this:</p>
  
  <p>x &lt;- log(1:200)</p>
  
  <p>Thanks in advance for any help!</p>