title: How to create NxM Corr matrix from Column 2 of 2xN signals in R?
body: <p>I have 2x N amount of 1D Signals in <code>files</code> where Column 1 is Signal 1 and  Column 2 Signal 2. 
  Code 1 is simplified example about 1x N amount of 1D signals, while Code 2 is the actual target with two pieces of pseudocode about: </p>
  
  <ol>
  <li>to create two dimensional vector (<code>files[[i]] = i,i+1</code>) - just two integer data units in each row separated by comma, and </li>
  <li>and then accessing the data there later (<code>tcrossprod( files[[]][, 2], files[[]][, 2] )</code>) where I cannot refer to all columns 2 of all signals</li>
  </ol>
  
  <p>Simplified Code 1 works as expected</p>
  
  <pre><code>## Example with 1D vector in Single column
  N &lt;- 7
  files &lt;- vector("list", N)
  # Make a list of two column data
  for (i in 1:N) {
      files[[i]] = i
  }
  
  str(files)
  
  # http://stackoverflow.com/a/40323768/54964
  tcrossprod( files, files )
  </code></pre>
  
  <p><strong>Code 2 is pseudocode but target</strong></p>
  
  <pre><code>## Example with 2x1D vectors in two columns
  N &lt;- 7
  files &lt;- vector("list", N)
  # Make a list of two column data
  for (i in 1:N) { 
      files[[i]] = i,i+1 # PSEUDOCODE 
  }
  
  str(files)
  
  # access one signal single columns by files[[1]][,1] and files[[1]][,2]
  tcrossprod( files[[]][, 2], files[[]][, 2] ) # PSEUDOCODE
  </code></pre>
  
  <p>Assume Vector 1 dimensions are Nx1 and Vector 1 1xM. 
  Each cell, accessed for instance for Signal 2 Column 2 by <code>files[[1]][,2]</code> contains 1D signal. 
  Mutiply all such signals of Column 2 by <code>trossprod</code>, you should get the expected result: <code>NxM</code> matrix. </p>
  
  <h2>Mathematical description</h2>
  
  <p>Data: a list of two columns, where first column is 1D signal; 2nd column is improved 1D signal. I want to compare those improved 1D signals all together in the matrix. 
  Expected output</p>
  
  <pre><code>   cor      Improved 1 Improved 2 ...
  Improved 1  1          0.55 
  Improved 2  0.111      1
  ...
  </code></pre>
  
  <p>I am not tied to any particular R data structures . </p>
  
  <p>Column and cell are just my descriptions of the items in the data units. So not precise because I am newbie in R. </p>
  
  <p>Output of tchakravarty's graphic code in my system where you see x-axis is correct but not y-axis</p>
  
  <p><a href="https://i.stack.imgur.com/9HYX2.png" rel="nofollow"><img src="https://i.stack.imgur.com/9HYX2m.png" alt="enter image description here"></a></p>
  
  <p>OS: Debian 8.5<br>
  R: 3.1.1</p>