title: Taking a mean of two vectors in R
body: <p>I would like to take the mean of the two vectors below and store the value in vector B2.  Note that I am trying to take the mean value by ROW.</p>
  
  <p>When I use:</p>
  
  <pre><code>B2 &lt;-mean(Macro$X1372C,Macro$X5244C)
  </code></pre>
  
  <p>I get the error: Error in mean.default(Macro$X1372C, Macro$X5244C) : 
    'trim' must be numeric of length one.  What code should I be using?</p>
  
  <p><a href="https://i.stack.imgur.com/k9O2E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k9O2E.png" alt="enter image description here"></a></p>
  
  <p>The mean vector would look like:</p>
  
  <p>Mean</p>
  
  <p>2.960409952</p>
  
  <p>3.012362779</p>
  
  <p>3.920078183</p>
  
  <p>3.286110877</p>
  
  <p>3.994996196</p>
  
  <p>3.916488088</p>
  
  <p>5.071798314</p>
  
  <p>3.745693115</p>
  
  <p>4.852409799</p>
  
  <p>4.438490606</p>
  
  <p>5.256816758</p>
  
  <p>4.174125673</p>
  
  <p>5.076089227</p>
  
  <p>4.532386721</p>