[R] Help with error on function: Error in .... attempt to apply non-function

Corrado ct529 at york.ac.uk
Tue Sep 15 12:32:53 CEST 2009


Dear Duncan,

this is a reproducible example: it is the function copied straight from my 
Eclipse.

I found the mistake (thanks to Peter) ....

On Tuesday 15 September 2009 11:15:29 Duncan Murdoch wrote:
> Corrado wrote:
> > Dear R gurrus,
> >
> > I wrote this function
> >
> > http://scsys.co.uk:8002/33852?ln=on&store=on&submit=Format+it!
> >
> > for a small package I am preparing.
> >
> > Whenever I run the function I get the error
> >
> > Error in Mspline(i = i, x = x, degree = kk, t = t) :  attempt to apply
> > non- function
> >
> > Anyone could point me out what I am doing wrong?
>
> It would be a lot easier to do so if you gave us a reproducible example.
> But the usual cause for that is using () instead of [], or forgetting an
> operator.  I think you've done the second:  you have (k-1)(t[i+k]-t[i])
> where you should have (k-1)*(t[i+k]-t[i]).
>
> Duncan Murdoch



-- 
Corrado Topi

Global Climate Change & Biodiversity Indicators
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: ct529 at york.ac.uk




More information about the R-help mailing list