title: Pairwise correlation between raster layers in R
body: <p>I need accomplish a pairwise Pearson correlation between 19 raster layers for Africa Continent extracted from WordClim database. I want to checking what are variables layers more correlated/significant to my model. For this i tried use the  layerStats function from Raster package, but after execute my output not contain numerical values, all the rows and columns showed NAs values. 
  Below is my script.</p>
  
  <pre><code>#Loading raster files from WorldClim database
  rastFiles&lt;- list.files(pattern="bil")
  a&lt;-stack(rastFiles)
  
  # Adjusting for African Continent
  newext&lt;-c(-20, 55, -35, 45)
  Africa&lt;-crop(a,newext)
  Africa
  
  #Correlation
  cor&lt;-layerStats(Africa,'pearson')
  </code></pre>