~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to tests/plots.R

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2009-10-26 14:30:00 UTC
  • mfrom: (1.1.13 upstream) (6.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20091026143000-wzwt6cryjnwce23k
Tags: 0.5.2-1
* new upstream release
  closes: #551306 (added support for the new dynamic help system)
* Add "DM-Upload-Allowed: yes" in control
* bump standards version to 3.8.3 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## intro
 
2
# This should be the first line in each test suite file: Include the
 
3
# test framework, unless already included (multiple inclusion would not
 
4
# really do any harm either, though
 
5
if (!isClass ("RKTestSuite")) source ("test_framework.R")
 
6
 
 
7
## definition of the test suite
 
8
suite <- new ("RKTestSuite", id="plots",
 
9
        # place here libraries that are required for *all* tests in this suite, or highly likely to be installed
 
10
        libraries = c ("R2HTML", "datasets", "graphics"),
 
11
        # initCalls are run *before* any tests. Use this to set up the environment
 
12
        initCalls = list (
 
13
                function () {
 
14
                        # prepare some different files for loading
 
15
                        library ("datasets")
 
16
                        data (women)
 
17
                        data (swiss)
 
18
                        data (warpbreaks)
 
19
 
 
20
                        x <- data.frame ("A" = rep (c (1, 2), 8), "B" = rep (c (1, 1, 2, 2), 4), "C" = rep (c (1, 1, 1, 1, 2, 2, 2, 2), 2), "D"= c (rep (1, 8), rep (2, 8)))
 
21
                        x[2,2] <- NA
 
22
                        assign ("test_table", x, envir=globalenv())
 
23
                }
 
24
        ## the tests
 
25
        ), tests = list (
 
26
                new ("RKTest", id="barplot", call=function () {
 
27
                        rk.call.plugin ("rkward::barplot", barplot_embed.colors.string="rainbow", barplot_embed.labels.state="1", barplot_embed.legend.state="0", barplot_embed.place.string="3", barplot_embed.plotoptions.add_grid.state="0", barplot_embed.plotoptions.asp.real="0.00", barplot_embed.plotoptions.main.text="", barplot_embed.plotoptions.pointcolor.color.string="", barplot_embed.plotoptions.pointtype.string="", barplot_embed.plotoptions.sub.text="", barplot_embed.plotoptions.xaxt.state="", barplot_embed.plotoptions.xlab.text="", barplot_embed.plotoptions.xlog.state="", barplot_embed.plotoptions.xmaxvalue.text="", barplot_embed.plotoptions.xminvalue.text="", barplot_embed.plotoptions.yaxt.state="", barplot_embed.plotoptions.ylab.text="", barplot_embed.plotoptions.ylog.state="", barplot_embed.plotoptions.ymaxvalue.text="", barplot_embed.plotoptions.yminvalue.text="", barplot_embed.type.string="juxtaposed", names_exp.text="rownames (swiss)", names_mode.string="rexp", tabulate.state="0", x.available="swiss[[\"Catholic\"]]", submit.mode="submit")
 
28
 
 
29
                        rk.call.plugin ("rkward::barplot", barplot_embed.colors.string="default", barplot_embed.legend.state="1", barplot_embed.plotoptions.add_grid.state="0", barplot_embed.plotoptions.asp.real="0.00", barplot_embed.plotoptions.main.text="", barplot_embed.plotoptions.pointcolor.color.string="", barplot_embed.plotoptions.pointtype.string="", barplot_embed.plotoptions.sub.text="", barplot_embed.plotoptions.xaxt.state="", barplot_embed.plotoptions.xlab.text="", barplot_embed.plotoptions.xlog.state="", barplot_embed.plotoptions.xmaxvalue.text="", barplot_embed.plotoptions.xminvalue.text="", barplot_embed.plotoptions.yaxt.state="", barplot_embed.plotoptions.ylab.text="", barplot_embed.plotoptions.ylog.state="", barplot_embed.plotoptions.ymaxvalue.text="", barplot_embed.plotoptions.yminvalue.text="", barplot_embed.type.string="stacked", names_exp.text="names (x)", names_mode.string="default", tabulate.state="0", x.available="test_table", submit.mode="submit")
 
30
                }),
 
31
                new ("RKTest", id="boxplot", call=function () {
 
32
                        rk.call.plugin ("rkward::box_plot", cex_sd_mean.real="1.00", mean.state="TRUE", names_exp.text="names (x)", names_mode.string="default", notch.state="FALSE", orientation.string="FALSE", outline.state="TRUE", pch_mean.real="15.", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", sd.state="", sd_mean_color.color.string="blue", x.available="women[[\"weight\"]]\nwomen[[\"height\"]]", submit.mode="submit")
 
33
                }),
 
34
                new ("RKTest", id="density_plot", call=function () {
 
35
                        rk.call.plugin ("rkward::density_plot", adjust.real="1.00", bw.string="nrd0", kern.string="gaussian", n.real="512.00", narm.state="na.rm=TRUE", plot_type.string="hdr_plot", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", rug.state="0", x.available="women[[\"height\"]]", submit.mode="submit")
 
36
                }, libraries = c ("hdrcde")),
 
37
                new ("RKTest", id="dotchart", call=function () {
 
38
                        rk.call.plugin ("rkward::dotchart", names_exp.text="women$weight", names_mode.string="rexp", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="This is a test", plotoptions.mainisquote.state="1", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="This is a subtitle", plotoptions.subisquote.state="1", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", tabulate.state="0", x.available="women[[\"height\"]]", submit.mode="submit")
 
39
 
 
40
                        rk.call.plugin ("rkward::dotchart", names_exp.text="names (x)", names_mode.string="default", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", tabulate.state="1", x.available="warpbreaks[[\"tension\"]]", submit.mode="submit")
 
41
                }),
 
42
                new ("RKTest", id="ecdf_plot", call=function () {
 
43
                        rk.call.plugin ("rkward::ecdf_plot", adjust_th_pnorm.state="1", col_rug.color.string="", col_thnorm.color.string="blue", lwd.real="0.50", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", rug.state="1", side.string="side = 3", stepfun_options.addtoplot.state="", stepfun_options.col_hor.color.string="", stepfun_options.col_points.color.string="", stepfun_options.col_y0.color.string="", stepfun_options.col_y1.color.string="", stepfun_options.do_points.state="1", stepfun_options.linetype.string="", stepfun_options.verticals.state="", th_pnorm.state="1", ticksize.real="0.03", x.available="swiss[[\"Catholic\"]]", submit.mode="submit")
 
44
                }),
 
45
                new ("RKTest", id="generic_plot", call=function () {
 
46
                        rk.call.plugin ("rkward::plot", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", xvarslot.available="swiss", yvarslot.available="", submit.mode="submit")
 
47
                }),
 
48
                new ("RKTest", id="histogram", call=function () {
 
49
                        rk.call.plugin ("rkward::histogram", adjust.real="4.00", bw.string="nrd", col_density.color.string="blue", density.state="1", histogram_opt.addtoplot.state="", histogram_opt.barlabels.state="1", histogram_opt.density.real="-1.", histogram_opt.doborder.state="1", histogram_opt.freq.state="0", histogram_opt.histbordercol.color.string="", histogram_opt.histbreaksFunction.string="vec", histogram_opt.histbreaks_veclength.real="6.", histogram_opt.histlinetype.string="solid", histogram_opt.include_lowest.state="1", histogram_opt.rightclosed.state="1", histogram_opt.usefillcol.state="", n.real="512.00", narm.state="na.rm=TRUE", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", x.available="swiss[[\"Education\"]]", submit.mode="submit")
 
50
                }),
 
51
                new ("RKTest", id="pareto_chart", call=function () {
 
52
                        rk.call.plugin ("rkward::pareto", descriptives.state="TRUE", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", tabulate.state="FALSE", x.available="swiss[[\"Catholic\"]]", submit.mode="submit")
 
53
                }, libraries=c("qcc", "xtable")),
 
54
                new ("RKTest", id="piechart", call=function () {
 
55
                        rk.call.plugin ("rkward::piechart", angle.real="45.00", angle_inc.real="6.00", clockwise.state="1", colors.string="grayscale", density.real="3.00", density_inc.real="1.00", names_exp.text="names (x)", names_mode.string="default", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", radius.real="0.80", tabulate.state="0", x.available="test_table[[\"A\"]]", submit.mode="submit")
 
56
                }),
 
57
                new ("RKTest", id="scatterplot", call=function () {
 
58
                        rk.call.plugin ("rkward::scatterplot", cex.text="1", col.text="c ('black', 'red')", color.string="each", isCex.string="all", isPch.string="all", pch.text="1", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", pointtype.string="p", type_mode.string="all", x.available="women[[\"weight\"]]\nswiss[[\"Education\"]]", y.available="women[[\"height\"]]\nswiss[[\"Catholic\"]]", submit.mode="submit")
 
59
                }),
 
60
                new ("RKTest", id="scatterplot_matrix", call=function () {
 
61
                        rk.call.plugin ("rkward::scatterplot_matrix", diag.string="histogram", ellipse.state="FALSE", plot_points.state="TRUE", smooth.state="FALSE", x.available="swiss", submit.mode="submit")
 
62
                }, libraries=c ("car")),
 
63
                new ("RKTest", id="stem_leaf_plot", call=function () {
 
64
                        rk.call.plugin ("rkward::stem", atom.real="0.01", scale.real="1.50", width.real="80.00", x.available="swiss[[\"Fertility\"]]", submit.mode="submit")
 
65
                }),
 
66
                new ("RKTest", id="stripchart", call=function () {
 
67
                        rk.call.plugin ("rkward::stripchart", g.available="warpbreaks[[\"tension\"]]", method.string="stack", offset.real="0.50", orientation.string="Horizontal", plotoptions.add_grid.state="0", plotoptions.asp.real="0.00", plotoptions.main.text="", plotoptions.pointcolor.color.string="", plotoptions.pointtype.string="", plotoptions.sub.text="", plotoptions.xaxt.state="", plotoptions.xlab.text="", plotoptions.xlog.state="", plotoptions.xmaxvalue.text="", plotoptions.xminvalue.text="", plotoptions.yaxt.state="", plotoptions.ylab.text="", plotoptions.ylog.state="", plotoptions.ymaxvalue.text="", plotoptions.yminvalue.text="", x.available="warpbreaks[[\"breaks\"]]", submit.mode="submit")
 
68
                })
 
69
        ), postCalls = list (   # like initCalls: run after all tests to clean up.
 
70
                function () {
 
71
                        suppressWarnings (rm (list=c ("women", "swiss", "warpbreaks", "test_table"), envir=globalenv()))
 
72
                }
 
73
        )
 
74
)
 
75
 
 
76
## always store the result in "results" and print it
 
77
results <- rktest.runRKTestSuite (suite)
 
78
print (results)