ellipsis.defaults | R Documentation |
Takes the ellipsis function parameter (of optional named arguments) and compares with a internal (named list) of defaults for any non-conflicting user specified inputs.
ellipsis.defaults(x, nl)
x |
the existing ellipsis passed as "list(...)" |
nl |
a named list of default parameter values |
a modified ellipsis variable (a named list of optional parameter values)
domy.xyplot <- function(data, x.name, y.name, ...){
ellipsis <- ellipsis.defaults(x=list(...), nl=list(ylab=y.name,xlab=x.name))
do.call( plot, c(list(x=data[,x.name],y=data[,y.name]), ellipsis))
}
domy.xyplot(data=mtcars, y.name='mpg', x.name='wt', xlab='weight')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.