title: how to calculate the Euclidean norm of a vector in R?
body: <p>I tried <code>norm</code>, but I think it gives the wrong result. (the norm of <code>c(1, 2, 3)</code> is <code>sqrt(1*1+2*2+3*3)</code>, but it returns <code>6</code>..</p>
  
  <pre><code>x1 &lt;- 1:3
  norm(x1)
  # Error in norm(x1) : 'A' must be a numeric matrix
  norm(as.matrix(x1))
  # [1] 6
  as.matrix(x1)
  #      [,1]
  # [1,]    1
  # [2,]    2
  # [3,]    3
  norm(as.matrix(x1))
  # [1] 6
  </code></pre>
  
  <p>Does anyone know what's the function to calculate the norm of a vector in R?</p>