[R-sig-Geo] What does the error "ERROR in .calcTest(x[1:5], fun, na.rm, forcefun, forceapply): cannot use this function" mean in R?

Bandrush Barda ndugarsuren at gmail.com
Wed May 7 11:51:16 CEST 2014


I have a problem with lowess function to predict NDVI as a function of time
by polynomial regression in R. NDVI image is 8-day image from Apr to Oct in
Julian date of 97 to 297. Here is the scripts I run:
 
#Created a time vector to act as x
time<-sort(sample(97:297, nlayers(ndvi2000crop1)))

#locally-weighted polynomial regression of ndvi ~ time
t.lowess <- function(x,...) { if (is.na(x[1])) {NA} else {lowess(x,y,...)$y
} } 
f.pred <- calc(ndvi2000crop1, t.lowess)

When I calculate the function on image by doing the last step of this code,
an error appeared something like this "Error in .calcTest(x[1:5], fun,
na.rm, forcefun, forceapply): cannot use this function". Can you tell me
where this error comes from and how to solve it? 

Thank you




--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/What-does-the-error-ERROR-in-calcTest-x-1-5-fun-na-rm-forcefun-forceapply-cannot-use-this-function-m-tp7586384.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list