title: Multiply values of column with itself in R
body: <p>I am trying to multiply elements of column with itself but am unable to do it.
  I have column A with values <code>a, b, c</code>, I want answer as <code>(a*b + a*c + b*c)</code>.</p>
  
  <p>For example, with
  <code>A &lt;- c(2, 3, 5)</code> the expected output is <code>sum(6 + 10 + 15) = 31</code>.</p>
  
  <p>I am trying to run for loop to execute but was failing. Can anyone please provide R code to do this.</p>