> Error in uniroot(integ, lower = 0, upper = 1000, n) :
>  'interval' must be a vector of length 2 >>>

> Please  would you be able to  give me an indication on why I am having this
> error message.

Because uniroot has a second parameter called 'interval' which overrides lower 
and upper and you have given uniroot a scalar called n as the first non-named 
argument. R has used its usual positional matching rules, which say that "Any 
unmatched formal arguments are bound to unnamed supplied arguments, in order." 
your first unmatched formal argument (interval) has been matched to your first 
unnamed argument (n) so uniroot has tried to use n as your interval.

You need to add your own parameters as named parameters; eg if your function 
took something called N, you would specify N=n

S Ellison

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to