Try this: foo <- function(data, ...) { ### here I want to check whether xlab was passed with the ... arguments ### or if the ... arguments did not contain an xlab argument args <- list(...) return(ifelse("xlab" %in% names(args), "Exists", "Missing")) }
On Thu, Dec 11, 2008 at 4:22 PM, Mark Heckmann <mark.heckm...@gmx.de> wrote: > Hi, > > How can I check if a certain ... argument has been passed on to my > user-defined function or not? > > foo <- function(data, ...) > { > ### here I want to check whether xlab was passed with the ... arguments > ### or if the ... arguments did not contain an xlab argument > } > > I tried missing(xlab) , exists(xlab) and several other things but did not > find a solution. > > TIA, > Mark > > ______________________________________________ > R-help@r-project.org 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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org 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.