title: Subtract lists from each other
body: <p>I am trying to subtract all files contained in one list from all files in another list. I have 64 items in both lists, with the data structured as follows:</p>
  
  <pre><code>FUTURE    List of 64
  
  file1 :'data.frame': 240 obs of 4 variables:
  ..$V1: int [1:240] 1986 1986 1986 1986...
  ..$V2: int [1:240] 1 2 3 4...
  ..$V3: int [1:240] 16 15 16 16...
  ..$V4: int [1:240] 154 118 137 128...
  ----------------------------------------------
  file64:'data.frame': 240 obs of 4 variables:
  ..$V1: int [1:240] 1986 1986 1986 1986...
  ..$V2: int [1:240] 1 2 3 4...
  ..$V3: int [1:240] 16 15 16 16...
  ..$V4: int [1:240] 122 189 107 114...
  ----------------------------------------------
  
      BASE    List of 64
  
  file1 :'data.frame': 240 obs of 4 variables:
  ..$V1: int [1:240] 1986 1986 1986 1986...
  ..$V2: int [1:240] 1 2 3 4...
  ..$V3: int [1:240] 16 15 16 16...
  ..$V4: int [1:240] 133 178 157 146...
  ----------------------------------------------
  file64:'data.frame': 240 obs of 4 variables:
  ..$V1: int [1:240] 1986 1986 1986 1986...
  ..$V2: int [1:240] 1 2 3 4...
  ..$V3: int [1:240] 16 15 16 16...
  ..$V4: int [1:240] 125 177 157 133...
  ----------------------------------------------
  </code></pre>
  
  <p>I simply want to subtract the fourth column ($V4) of all files contained in the BASE list from the same column of all files contained in the FUTURE list.</p>
  
  <p>If these were simple dataframes I could just use:</p>
  
  <pre><code>CALC=FUTURE$V4-BASE$V4
  </code></pre>
  
  <p>but of course it is a bit more complicated with lists.</p>
  
  <p>I have tried:</p>
  
  <pre><code>CALC=lapply(FUTURE, function(x) x["V4"] - BASE["V4"])
  </code></pre>
  
  <p>but I get the error message:</p>
  
  <pre><code> Error in data.frame(value, row.names = rn, check.names = FALSE, check.rows  = FALSE) :
  row names supplied are of the wrong length 
  </code></pre>
  
  <p>Any ideas as to how to remedy this?</p>