I want to apply a moving window (3x3) to estimate conditional entropy (Nowosad & Stepinsky, 2019) over a heterogeneous landscape:
entropy=function(r){ entro