[R-gregmisc-users] SF.net SVN: r-gregmisc:[1902] trunk/gplots/R/bandplot.R
Brought to you by:
warnes
From: <wa...@us...> - 2014-12-02 01:09:05
|
Revision: 1902 http://sourceforge.net/p/r-gregmisc/code/1902 Author: warnes Date: 2014-12-02 01:09:01 +0000 (Tue, 02 Dec 2014) Log Message: ----------- Code cleanup. Modified Paths: -------------- trunk/gplots/R/bandplot.R Modified: trunk/gplots/R/bandplot.R =================================================================== --- trunk/gplots/R/bandplot.R 2014-12-02 00:07:48 UTC (rev 1901) +++ trunk/gplots/R/bandplot.R 2014-12-02 01:09:01 UTC (rev 1902) @@ -59,7 +59,7 @@ bandplot.formula <- function(x, - data=parent.frame(), + data, subset, na.action, xlab=NULL, @@ -80,20 +80,24 @@ if (missing(na.action)) na.action <- getOption("na.action") + ## construct call to model.frame to generate model matrix mf <- match.call(expand.dots = FALSE) - m <- match(c("x", "data", "subset", "na.action"), names(mf), 0L) - - # rename 'x' to 'formula' - names(mf)[m[2]] <- "formula" - mf <- mf[c(1L, m)] mf$drop.unused.levels <- TRUE mf[[1L]] <- quote(stats::model.frame) + + ## rename 'x' to 'formula' + names(mf)[2] <- "formula" + mf <- eval(mf, parent.frame()) + ## now extract x and y response <- attr(attr(mf, "terms"), "response") + x <- mf[[-response]] + y <- mf[[response]] + ## get x and y axis labels sx <- substitute(x) if (is.null(xlab)) { @@ -110,8 +114,9 @@ ylab <- "y" } - bandplot.default(x=mf[[-response]], - y=mf[[response]], + ## now call the default method to actually do the work + bandplot.default(x, + y, ..., xlab=xlab, ylab=ylab, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |