[R-sig-eco] number of pixels in a circular window for GRASS r.neighbors function

cparker at pdx.edu cparker at pdx.edu
Wed Oct 12 15:40:34 CEST 2011


I am going out on a limb here as I have never uses this function but based on what you wrote you could probably just change function=sum to function=mean. I am assuming (based on what you said) that the function (r.neighbors) imposes the condition first (eg x==1) and then sums the resulting 0s and 1s to get the number equal to 1. If that's the case you can change sum to mean to get the proportion. 



On Oct 12, 2011, at 3:39 AM, Alexandre Villers <villers.alexandre at gmail.com> wrote:

> Dear list,
> 
> I have calculated the number of pixels whose value=1 for different radii 
> using the r.neighbors function (method= circular, function=sum). I would 
> like to compute the proportion of cells with this value and for that,  
> I'm trying to figure out the effective number of pixels that are used 
> for each radius. From the documentation 
> <http://grass.osgeo.org/gdp/html_grass64/r.neighbors.html>, above a 
> diameter of d = 9 cells, the result seems to be d^2-  4 * (d-1)  cells 
> but I was wondering if someone could confirm this to me? Is this 
> relationship conserved for larger diameter.
> 
> Thanks for any hint
> 
> Alexandre
> 
> 
> P.S.: I already posted this message on the Grass stats list but maybe I 
> wasn't clear enough and as a result didn't get any answer
> 
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list