Dear userRs,

Is there a way to explicitly set an argument to a function call as
missing?

E.g.,

histogram(foo,
          bar,
          endpoints=ifelse(!missing(limits),limits,NA/NULL/whatever)))

In this call I want to set a value to the endpoints argument only if the
`limits' variable has been set, and leave the defaults otherwise.

The only way I could do it is thus:

if (!missing(limits)) histogram(foo,bar,endpoints=limits)
else histogram(foo,bar)

Is there a cleaner way?

Kind regards,

David Lindelof

______________________________________________
R-help@stat.math.ethz.ch 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