Dear all,

I am trying to use the function smooth.spline with the calc function in the
raster package for x,y,z files. I would like to perform the following
function across the z time series (n=248) for my x by y matrix:

> smooth.spline(z, df = 60)$y

I wrote the function

> splinepixel<- function(x){

  yvalues<-smooth.spline(x,df=60)$y

return(yvalues)}


and then ran it with calc:

> output = calc(r,fun=splinepixel)


I get the error:

Error in smooth.spline(x, df = 60) : need at least four unique 'x' values


Any help is much appreciated! Thanks.

Meha

	[[alternative HTML version deleted]]

