title: Arithmetical calculation with RStudio
body: <p>Here is my very simple question:<br>
  How to calculate sum, difference and product between values of vector_a and vector_b, with RStudio.</p>
  
  <pre><code>vector_a &lt;- (-5:5)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>vector_b &lt;- (0:10)
  </code></pre>
  
  <p>I have to calculate the difference/sum/product between values in vector_a and values in vector_b.</p>
  
  <pre><code>Sum &lt;- sum(vector_a, vector_b) 
  </code></pre>
  
  <p>returns value 55.<br>
  But product and difference functions return strange results.</p>
  
  <p>If I use the command:</p>
  
  <pre><code>Difference &lt;- vector_a - vector_b
  </code></pre>
  
  <p>this returns values 1, 1, 1, 1,1,..</p>
  
  <p>When I use the command:</p>
  
  <pre><code>Difference &lt;- diff(vector_a, vector_b)
  </code></pre>
  
  <p>it returns an error!<br>
  Can anybody explain what are the right commands for these basic calculations?</p>