Description Usage Arguments Details Value Note See Also Examples
Compares plots/warnings/errors from plotExpr
,
plotFile
, or plotFunction
.
For the text-based formats (i.e. pdf or ps), a .diff file is created.
If ImageMagick is installed, plots of the differences will also be
produced.
1 2 |
test, control |
either:
The specification for |
path |
character vector; specifies where all the diff output (.diff files, plots of differences, and comparison logs) should be placed. |
erase |
character vector; one of
Currently only |
Plots are compared using GNU diff. If a difference is detected and the current filetype being compared is a text-based format, a .diff file will be produced. If ImageMagick is installed, plots of differences will also be created.
It is possible for some plots to appear say, in the test group, but
not in the control group (i.e. the function plot
has an extra
example plot in a new version of R). These such plots are classified
as ‘unpaired’. Unpaired files do not have a corresponding plot
to compare with so are separated into an unpaired section. It is also
possible for entire filetypes to be unpaired. Currently if there is a
completely unpaired function or file when trying to compare, recycling
will be used. This is intended to change in the future.
In many instances, it is also useful to know whether there is any change in warnings or errors. If any difference is detected in the warnings/errors for a filetype, all of the warnings or errors (whichever had the difference detected) for that filetype are given. It is then up to the user to decide what the difference is (i.e. whether the ordering has changed or if one group has an extra warning etc.).
For each set of plot-logs being compared, a comparison log will be
produced. So for each pair of qcPlotExprResult logs being compared, a
comparison log will be produced with a name of the form
‘testPrefix+controlPrefix-compareExprLog.xml’. When comparing
qcPlotFileResults or qcPlotFunctionResults there will also be a
compareFileLog or compareFunLog produced which will take a name of the
form ‘testPrefix+controlPrefix-compareFunLog.xml’, where the
testPrefix and controlPrefix are chosen from the first prefixes in the
set of compareExprLogs being compared (which in turn come from the first
plotExpr logs). These logs are placed in path
.
A list of class qcCompareExprResult
, qcCompareFileResult
or
qcCompareFunResult
containing the results of the comparisons.
qcCompareExprResult
files contain a list of info about the Operating
System, R version, date, call, the info from the test, info from the
control, and then information about the results of the comparisons
(results by filetype giving the result, names of diff files and plots of
differences if produced), including any unpaired plots or filetypes
(with corresponding warnings/errors).
For qcCompareFile
or qcCompareFun
an initial info
section is included, followed by a list containing each individual
qcCompareExprResult
.
GNU diff must be installed on the system. ImageMagick is not necessary, but greatly extends functionality.
plotExpr
, plotFile
,
plotFunction
, writeReport
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
# Create sets to compare (1st and 3rd are different)
comp1 <- plotExpr(c("plot(1:10)", "plot(4:40)", "x<-3", "plot(2:23)"),
c("pdf", "ps"), "myPrefix", "comp1")
comp2 <- plotExpr(c("plot(1:11)", "plot(4:40)", "x<-3", "plot(5:15)"),
c("pdf", "ps"), "myPrefix", "comp2")
compExpr <- compare(comp1, comp2)
# All the diff output has been placed in "comp1" (the test directory)
compExpr
# For a better way of viewing this, see ?writeReport
## End(Not run)
|
sh: 1: compare: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: compare: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Warning messages:
1: running command 'compare -version' had status 126
2: running command 'compare -version' had status 126
qcCompareExpr Result:
Call:
compare(comp1, comp2)
Test Control Results
R version: R version 3.4.4 (2018-03-15) R version 3.4.4 (2018-03-15)
Directory: /work/tmp/myPrefix /work/tmp/myPrefix
Filename: comp1-log.xml comp2-log.xml
Format:
pdf ...k/tmp/myPrefix/comp1-1.pdf ...k/tmp/myPrefix/comp2-1.pdf identical
...k/tmp/myPrefix/comp1-2.pdf ...k/tmp/myPrefix/comp2-2.pdf identical
...k/tmp/myPrefix/comp1-3.pdf ...k/tmp/myPrefix/comp2-3.pdf identical
ps /work/tmp/myPrefix/comp1-1.ps /work/tmp/myPrefix/comp2-1.ps different
/work/tmp/myPrefix/comp1-2.ps /work/tmp/myPrefix/comp2-2.ps different
/work/tmp/myPrefix/comp1-3.ps /work/tmp/myPrefix/comp2-3.ps different
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.