title: Why does R scale{raster} function give a different output than scaling the same raster in PythonWin?
body: <p>I've used both R and PythonWin to spatially apply a statistical model. I created the same prediction raster in both programs and the outputs are different (not crazy different but different). I'm wondering if the difference between the two prediction rasters could be due to a scaling issue (I had to scale the values in my rasters because I scaled the variables in the model I'm applying)?</p>
  
  <p>I have large raster files that are 23546 columns x 9157 rows, 30 x 30 cell size, and a floating pixel type. If I scale the values of a raster in R using scale{raster}, the output has a mean of 7.9e-17 and stdev 1.</p>
  
  <pre><code>inputras&lt;-raster(file)
  outras1&lt;-scale(inputras)
  cellStats(outras1, mean)
  # returns 7.874414e-17
  cellStats(outras1, sd)
  # returns 1
  </code></pre>
  
  <p>If I scale the values of the same raster by subtracting the mean and dividing by the standard deviation I get the same output. No surprise.</p>
  
  <pre><code>X&lt;-cellStats(inputras, mean)
  Y&lt;-cellStats(inputras, sd)
  outras2&lt;-(inputras-X)/Y
  cellStats(outras2, mean)
  # returns 7.874414e-17
  cellStats(outras2, sd)
  #returns 1
  </code></pre>
  
  <p>If I do this in PythonWin using arcpy.GetRasterProperties for the same raster I get a different output.</p>
  
  <pre><code>inputras=arcpy.Raster(file)
  X=float(arcpy.GetRasterProperties_management (inputras, "MEAN").getOutput(0))
  Y=float(arcpy.GetRasterProperties_management (inputras, "STD").getOutput(0))
  outras=(inputras-X)/Y
  A=arcpy.GetRasterProperties_management (outras, "MEAN")
  B=arcpy.GetRasterProperties_management (outras, "STD")
  print A, B
  #returns a mean of -6.8e-8 and a stdev of 0.999
  </code></pre>
  
  <p>I should maybe point out that the min and max are the same for all outputs. </p>
  
  <p>Why are the means different for the output from R vs. PythonWin while using (to my knowledge) the same method of scaling values? Thanks in advance for any thoughts you might have on the matter.  </p>