title: R constructing sparse Matrix
body: <p>I'm reading through instructions of Matrix package in R. But I couldn't understand the <code>p</code> argument in function:</p>
  
  <pre><code>sparseMatrix(i = ep, j = ep, p, x, dims, dimnames,
           symmetric = FALSE, index1 = TRUE,
           giveCsparse = TRUE, check = TRUE)
  </code></pre>
  
  <p>According to <a href="http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/sparseMatrix.html" rel="nofollow">http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/sparseMatrix.html</a></p>
  
  <blockquote>
    <p>p:<br>
    numeric (integer valued) vector of pointers, one for each column (or row), to the 
    initial (zero-based) index of elements in the column (or row). Exactly one of i, j or p 
    must be missing.</p>
  </blockquote>
  
  <p>I figured <code>p</code> is for compressed representation of either the row or column indices because it's wasteful to have multiple elements in either <code>i</code> or <code>j</code> to have the same value to represent a single row/column. But when I tried the example provided, I still couldn't figure out how <code>p</code> is controlling which element of <code>x</code> goes to which row/column</p>
  
  <pre><code>dn &lt;- list(LETTERS[1:3], letters[1:5])
  ## pointer vectors can be used, and the (i,x) slots are sorted if necessary:
  m &lt;- sparseMatrix(i = c(3,1, 3:2, 2:1), p= c(0:2, 4,4,6), x = 1:6, dimnames = dn)
  </code></pre>