I have a function
somefun <- function(someparameters , ...) { plot(stuff, ...)}
Now I would like to provide some defaults for plot in the case that the user hasn’t specified those arguments. (i.e. xlab="").
How do I provide a set of default plot options but still allow the user to override those arguments? Since if the same argument is inputted twice, R will throw the error: formal argument matched by multiple actual arguments.
I am aware that I can pass on all these options through my function
somefun <- function(someparameters, main, xlab, ylab, xlim....)
but I would rather not do that.
Is there some easy neat solution to achieve this?
Try
modifyListused as follows: