[GRASS-user] r.covar vs layerStats in R

Markus Neteler neteler at osgeo.org
Mon Nov 19 02:41:02 PST 2018


On Sun, Nov 18, 2018 at 10:32 PM Micha Silver <tsvibar at gmail.com> wrote:
>
> I am preparing a correlation matrix for 7 raster layers. The results using the r.covar module are different from the R layerStats function. I suspect this is due to handling of null cells. The R function has a parameter to remove NA cells, but the GRASS module, I think, just loops over all cells, including no value.
>
>
> Can anyone confirm that GRASS does not deal with null cells, and that this would cause the difference in correlation results?

Here how r.covar treats NULL cells:

https://trac.osgeo.org/grass/browser/grass/trunk/raster/r.covar/main.c#L93

Markus


More information about the grass-user mailing list