ellipsis.defaults: Modify defaults of possible optional ellipsis parameter...

View source: R/plots.R

ellipsis.defaultsR Documentation

Modify defaults of possible optional ellipsis parameter values passed to a function

Description

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.

Usage

ellipsis.defaults(x, nl)

Arguments

x

the existing ellipsis passed as "list(...)"

nl

a named list of default parameter values

Value

a modified ellipsis variable (a named list of optional parameter values)

Examples



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')


caroline documentation built on Oct. 21, 2024, 9:06 a.m.