Skip to content
Prev 360858 / 398506 Next

how to manipulate ... in the argument list

Duncan suggested to use the argument explicitly and combine it with
the missing function which is for this problem also my preferred
solution:


image.2 <- function(x, col , breaks, ...){
  # function is manipulating colors (adding a few)
  # since it changes colors it needs to update breaks if defined.

  if( !missing(breaks) ){
     #manipulate breaks

    image(x, col, breaks  ,...)

   }else{
      image(x,col ,...)
   }
}

It is good to know that I also could have used do.call.

I also learned yesterday that it is better to search for dot dot dot
argument or for elipsis instead of  ...

best
On 11 May 2016 at 15:45, Vito M. R. Muggeo <vito.muggeo at unipa.it> wrote: