title: How to represent a list of points in R
body: <p>I am working with a large list of points (each point has three dimensions x,y,z).</p>
  
  <p>I am pretty new with R, so I would like to know what is the best way to represent that kind of information.  As far as I know, an array allows me to represent any multidimensional data, so currently I am using:</p>
  
  <pre><code>&gt; points&lt;-array( c(1,2,0,1,3,0,2,4,0,2,5,0,2,7,0,3,8,0), dim=c(3,6) )
  &gt; points
       [,1] [,2] [,3] [,4] [,5] [,6]
  [1,]    1    1    2    2    2    3  -- x dim
  [2,]    2    3    4    5    7    8  -- y dim
  [3,]    0    0    0    0    0    0  -- z dim
  </code></pre>
  
  <p>The aim is to perform some computations to calculate the euclidean distance between two sets of points such as:</p>
  
  <pre><code>points1&lt;-array( c(1,2,0,1,3,0,2,4,0,2,5,0,2,7,0,3,8,0), dim=c(3,6) )
  points2&lt;-array( c(2,2,0,1,4,0,2,3,0,2,4,0,2,6,0,2,8,0), dim=c(3,6) )
  </code></pre>
  
  <p>(any hint in this sense would also be highly appreciated)</p>