Last chance! 50% off unlimited learning
Sale ends in
SmartControl(call,
keys,
ignore,
defaults,
forced,
split,
ignore.case=TRUE,
replaceDefaults,
verbose = TRUE)
list(...)
.call
before processing."\."
.TRUE
then all matching and splitting is not case sensitive.TRUE
default arguments are replaced by given
arguments. Can also be a named list with entries for each subroutine.TRUE
warning messages are given for arguments in
call
that are not ignored via argument ignore
and that do not match any key
.plot.prodlim
dumPlot = function(...){
## set defaults
plot.DefaultArgs=list(x=0,y=0,type="n")
lines.DefaultArgs=list(x=1:10,lwd=3)
## apply smartcontrol
x=SmartControl(call=list(...),
defaults=list("plot"=plot.DefaultArgs, "lines"=lines.DefaultArgs),
ignore.case=TRUE,keys=c("plot","axis2","lines"),
forced=list("plot"=list(axes=FALSE),"axis2"=list(side=2)))
## call subroutines
do.call("plot",x$plot)
do.call("lines",x$lines)
do.call("axis",x$axis2)
}
dumPlot(plot.ylim=c(0,5),plot.xlim=c(0,20),lines.lty=3,axis2.At=c(0,3,4))
Run the code above in your browser using DataLab