title: Applying a function to two lists?
body: <p>To find the row-wise correlation of two matrices X and Y, the output should have a correlation value for row 1 of X and row 1 of Y, ..., hence in total ten values (because there are ten rows):</p>
  
  <pre><code>X &lt;- matrix(rnorm(2000), nrow=10)
  Y &lt;- matrix(rnorm(2000), nrow=10)
  
  sapply(1:10, function(row) cor(X[row,], Y[row,]))
  </code></pre>
  
  <p>Now, how should I <strong>apply this function to two lists (containing around 50 dataframes each)?</strong></p>
  
  <p>Consider list A has dataframes $1, $2, $3... and so on and list B has similar number of dataframes $1, $2, $3. So the function should be applied to <code>listA$1,listB$1</code> and <code>listA$2,listB$2</code> ... and so on for other dataframes in the list. In the end I will have ten values in case of comparison 1 (<code>listA$1</code> and <code>listB$1</code>) and for others as well.</p>
  
  <p>Could this be done using "lapply"?</p>