Dear Graham,

On 16 June 2013 02:08, Graham McDannel <graham.mcdan...@gmail.com> wrote:
> I am attempting to optimize a function I have developed using optim.
>
> I am getting the below error message:
>
> Error in n < 1: 'n' is missing
>

I suspect a function requires an argument named n, and you
didn't pass one.  Either in your objective function or in optim.
See blow example that produce a similar error:
> f <- function(n) {
+    if(n <1) {
+     print("one")
+    }
+ }
> f()
Error in n < 1 : 'n' is missing


Best Wishes,
-m

______________________________________________
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