it doesn't actually- this should work: expand.call <- function(call=sys.call(sys.parent(1)), expand.dots = TRUE) # similar to match.call, but with all formal args not the specified ones only { ans <- as.list(call) frmls <- formals(deparse(ans[[1]])) add <- which(!(names(frmls) %in% names(ans))) return(as.call(c(ans, frmls[add]))) }
On Thu, Jul 30, 2009 at 11:22 AM, Fabian Scheipl < fabian.sche...@stat.uni-muenchen.de> wrote: > This does what you want: > > expand.call <- function(definition = NULL, call = sys.call(sys.parent()), > expand.dots = TRUE) > # like match.call, but with all formal args instead of only the specified > ones > { > ans <- as.list(match.call(definition, call, expand.dots)) > frmls <- formals(deparse(ans[[1]])) > add <- which(!(names(frmls) %in% names(ans))) > return(as.call(c(ans, frmls[add]))) > } > > Best, > Fabian > [[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.