Hello Etienne,

Did you check mean or sd?
I did the test and I faced the same problem. mean  worked fine but not 
with sd:
e <- drawExtent() # click on two points to draw a window
 > saf_test <- crop(saf, e)
 > movi <-  overlay(saf_test, fun=function(x) movingFun(x, fun=mean, 
n=3,  na.rm=TRUE))#  fine
 > movi <-  overlay(saf_test, fun=function(x) movingFun(x, fun=sd, n=3,  
na.rm=TRUE))# not fine
Error in .overlayList(x, fun = fun, filename = filename, ...) :
   cannot use this formula, probably because it is not vectorized

On 19/03/2013 14:54, Etienne B. Racine wrote:
> plot(saf, 1)
> e <- drawExtent() # click on two points to draw a window
> saf_test <- crop(saf, e)
> # ... use saf_test
> movi <-  overlay(saf_test, fun=function(x) movingFun(x, fun=mean, n=3, 
>  na.rm=TRUE))


-- 
Amen Alyaari, UPMC
PhD student
Unit of Functional Ecology&  Environmental Physics [EPHYSE]
National Institute of Agricultural Research [INRA].
71, Avenue Edouard Bourlaux
33140 Villenave d'Ornon
Téléphone : +33(0) 5 57 12 24 27
Fax : +33 (0)5 57 12 24 20
FRANCE


	[[alternative HTML version deleted]]

