[Distr-commits] r1201 - in branches/distr-2.8/pkg/distrTEst: R inst man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 12 19:05:18 CEST 2018
Author: ruckdeschel
Date: 2018-07-12 19:05:18 +0200 (Thu, 12 Jul 2018)
New Revision: 1201
Modified:
branches/distr-2.8/pkg/distrTEst/R/plot-methods.R
branches/distr-2.8/pkg/distrTEst/inst/NEWS
branches/distr-2.8/pkg/distrTEst/man/plot-methods.Rd
Log:
[distrTest] branch 2.8
plot methods now return an S3 object of class \code{c("plotInfo","DiagnInfo")}, i.e., a list containing the
information needed to produce the respective plot, which at a later stage could be used by different graphic engines (like, e.g.
\code{ggplot}) to produce the plot in a different framework. A more detailed description will follow in a subsequent version.
Modified: branches/distr-2.8/pkg/distrTEst/R/plot-methods.R
===================================================================
--- branches/distr-2.8/pkg/distrTEst/R/plot-methods.R 2018-07-12 16:52:56 UTC (rev 1200)
+++ branches/distr-2.8/pkg/distrTEst/R/plot-methods.R 2018-07-12 17:05:18 UTC (rev 1201)
@@ -4,13 +4,20 @@
function(x,
runs0=1:nrow(result(x)), dims0=1:ncol(result(x)), ...
){
- dots <- list(...)
+ args0 <- list(x=x, runs0=runs0, dims0=dims0)
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ dots <- match.call(call = sys.call(sys.parent(1)),
+ expand.dots = FALSE)$"..."
+ plotInfo <- list(call = mc, dots=dots, args=args0)
ldim0 <- min(getdistrTEstOption("MaxNumberofPlottedEvaluationDims"),
length(dims0))
if(ldim0<length(dims0))
warning(paste("your evaluation is too big; only ", ldim0,
"evaluation dimensions are plotted"))
- boxplot(result(x)[runs0,dims0[1:ldim0]],...)
+ plotInfo$boxplot <- boxplot(result(x)[runs0,dims0[1:ldim0]],...)
+ plotInfo$usr <- par("usr")
+ class(plotInfo) <- c("plotInfo","DiagnInfo")
+ return(invisible(plotInfo))
}
)
@@ -23,7 +30,12 @@
ncol(result(Elist(x)[[1]]))/2,
ncol(result(Elist(x)[[1]]))),
evals0=1:length(Elist(x)), ... )
-{ dots <- list(...)
+{ args0 <- list(x=x, runs0=runs0, dims0=dims0, evals0=evals0)
+ mc <- match.call(call = sys.call(sys.parent(1)))
+ dots <- match.call(call = sys.call(sys.parent(1)),
+ expand.dots = FALSE)$"..."
+ plotInfo <- list(call = mc, dots=dots, args=args0)
+ dots <- list(...)
ldim0 <- min(getdistrTEstOption("MaxNumberofPlottedEvaluationDims"),
length(dims0))
@@ -120,6 +132,7 @@
on.exit(par(opar))
par(mfrow=c(resdim0,1))
+ plotInfo$boxplot <- plotInfo$usr <- plotInfo$bpdots <-vector("list",resdim0)
for(i in 1:resdim0)
{if("main" %in% names(dots))
@@ -132,8 +145,10 @@
dots[["ylim"]] <- ylim0[,i]
dots[["x"]]<- as.data.frame(ma[,(i-1)*len0+(1:len0)])
- do.call("boxplot", args = dots)
-
+ plotInfo$bpdots[[i]] <- dots
+ plotInfo$boxplot[[i]] <- do.call("boxplot", args = dots)
+ plotInfo$usr[[i]] <- par("usr")
}
- return(invisible())
+ class(plotInfo) <- c("plotInfo","DiagnInfo")
+ return(invisible(plotInfo))
})
Modified: branches/distr-2.8/pkg/distrTEst/inst/NEWS
===================================================================
--- branches/distr-2.8/pkg/distrTEst/inst/NEWS 2018-07-12 16:52:56 UTC (rev 1200)
+++ branches/distr-2.8/pkg/distrTEst/inst/NEWS 2018-07-12 17:05:18 UTC (rev 1201)
@@ -8,6 +8,16 @@
information)
##############
+v 2.8
+##############
+
+user-visible CHANGES:
+
+plot methods now return an S3 object of class \code{c("plotInfo","DiagnInfo")}, i.e., a list containing the
+information needed to produce the respective plot, which at a later stage could be used by different graphic engines (like, e.g.
+\code{ggplot}) to produce the plot in a different framework. A more detailed description will follow in a subsequent version.
+
+##############
v 2.7
##############
Modified: branches/distr-2.8/pkg/distrTEst/man/plot-methods.Rd
===================================================================
--- branches/distr-2.8/pkg/distrTEst/man/plot-methods.Rd 2018-07-12 16:52:56 UTC (rev 1200)
+++ branches/distr-2.8/pkg/distrTEst/man/plot-methods.Rd 2018-07-12 17:05:18 UTC (rev 1201)
@@ -15,6 +15,13 @@
(i.e.; a vector of length (result-dimension), respectively a 2 x (result-dimension) matrix)
or globally, using the usual recycling rules.}
}}
+\value{An S3 object of class \code{c("plotInfo","DiagnInfo")}, i.e., a list
+ containing the information needed to produce the
+ respective plot, which at a later stage could be used by different
+ graphic engines (like, e.g. \code{ggplot}) to produce the plot
+ in a different framework. A more detailed description will follow in
+ a subsequent version.
+}
\concept{S4 evaluation class}
\keyword{methods}
\keyword{hplot}
More information about the Distr-commits
mailing list