Skip to content
Back to formatted view

Raw Message

Message-ID: <CAPtbhHw_6fs5MUkeLnVc1Nx+yGLcW47yj8sP4X8E-TRgv+kDXg@mail.gmail.com>
Date: 2013-06-17T07:11:31Z
From: Suzen, Mehmet
Subject: Optimization of a function using optim
In-Reply-To: <CAJhGg+0U98D9VhZ+gghvJ8y-AXSqQ=F5uSsi3XeXivC4u1c9Yg@mail.gmail.com>

Dear Graham,

On 16 June 2013 02:08, Graham McDannel <graham.mcdannel at 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