Re: [R] Possible bug in optimize (related to naming the arguments)

2020-05-07 Thread Peter Dalgaard
Partial matching is a feature regretted by its designer, but is not really possible to remove at this point. One early change in R relative to S was to require full match of anything after "...", but as you have noticed, that does not apply for interval= So, "don't do that, then" -pd > On 7

Re: [R] Possible bug in optimize (related to naming the arguments)

2020-05-07 Thread Ege Rubak
Dear Søren, I suspect that the good R souls wouldn't consider this a bug, but a logical consequence of the R language design. It is of course a valid question whether this should be explicitly mentioned in documentation. If I recall correctly about function evaluation: First all named arguments a

[R] Possible bug in optimize (related to naming the arguments)

2020-05-07 Thread Søren Højsgaard
Dear all, I am wondering if there is a minor bug in the optimimize function; please see below: --- > ## example taken from optimize documentation > f <- function (x, a) (x - a)^2 > xmin <- optimize(f, c(0, 1), tol = 0.0001, a = 1/3) > xmin $minimum [1] 0.333 $objective [1] 0 > ## if we