title: Calculating running window Spearman correlation and pvalue in R
body: <p>I wish to calculate a running window Spearman correlation in R.
  So far I've been using <code>running</code> from <code>gtools</code> package, but I could only get Pearson correlation out of it.
  I tried to modify the <code>fun</code> parameter but couldn't get it to produce anything but errors.</p>
  
  <p>My input is a data.frame:</p>
  
  <pre><code>row.names   Small   Large
  1   1   97.80341    88.71192
  2   2   97.46807    87.96206
  3   3   97.18862    88.13904
  4   4   97.76615    87.67329
  5   5   97.09081    87.52425
  6   6   97.16067    87.85493
  7   7   97.73820    88.43712
  </code></pre>
  
  <p>etc. 
  And this is the basic running command I tried to manipulate:</p>
  
  <pre><code>corr_table &lt;- running (mytable$Large, mytable$Small,fun=cor, width=20, by=10, allow.fewer=FALSE, pad=FALSE, align="left")
  </code></pre>
  
  <p>My second question is how can I add the pvalue of each "window" ?</p>
  
  <p>Thanks!</p>