title: R raster multiplication - why does the raster size increase tremendously
body: <p>I am working with MODIS raster-data in R (raster package) and I wonder, why the size of a raster becomes 7000 times larger when multiplying two raster files. In my case, one raster is a simple MODIS raster (values between 0 and 255 (integer)), the other one is kind of a template (0 and 1 (integer)). So I don't understand why the raster should be so large? It is a big problem when trying to save the raster with writeRaster, as my R session keeps crashing. </p>
  
  <p>My code looks like this:</p>
  
  <pre><code>a &lt;- list.files('All_MODIS_files_of_one_year.tif')
  for (day in 1:length(a)){
  ra &lt;- raster(a[day])
  ra_reduce &lt;- ra * s
  </code></pre>
  
  <p>Object size of <code>ra</code> is 12064 bytes, object size of <code>s</code> is 11984 bytes. Object size of <code>ra_reduce</code> is 93777512 bytes. When I finally stack a whole year, the file becomes almost 40 GB large. :(</p>
  
  <p>I tried the <code>round</code> function, tried to set the <code>@file@datanotation</code> to integer, but nothing helped. 
  Has anyone an idea how to fix this?! </p>