title: How to square all the values in a vector in R?
body: <p>I would like to square every value in <code>data</code>, and I am thinking about using a for loop like this:</p>
  
  <pre><code>data = rnorm(100, mean=0, sd=1)
  Newdata = {L = NULL;  for (i in data)  {i = i*i}  L = i  return (L)}
  </code></pre>