title: Using mosaic in r to merge multiple geotiff
body: <p>I have 50 geotiff files in the same folder.
  All of them represent elevation data in different parts of the world.
  I would like to merge certain geotiff files, and I found <code>mosaic</code> in R might help us.
  I have moved those geotiff into the same folder, and I wrote a R script show below:</p>
  <pre><code>setwd()
  a&lt;-list.files(pattern=&quot;*.tiff&quot;,file.name=TRUE)
  combind&lt;-merge(a,fun=mean)
  </code></pre>
  <p>However, this script returned an error:
  error in as.data.frame(y)</p>
  <p>May I ask how could I improve my script?</p>