[rkward-cvs] [rkward] /: Add i18n()-calls to plot plugins' .js files.
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Jan 9 14:43:55 UTC 2015
Git commit 3ff25b6103822af2becadbb456428d852b666fd4 by Thomas Friedrichsmeier.
Committed on 09/01/2015 at 13:10.
Pushed by tfry into branch 'master'.
Add i18n()-calls to plot plugins' .js files.
M +3 -3 rkward/plugins/plots/barplot.js
M +1 -1 rkward/plugins/plots/barplot_embed.js
M +11 -11 rkward/plugins/plots/box_plot.js
M +2 -2 rkward/plugins/plots/cor_graph.js
M +3 -3 rkward/plugins/plots/cor_graph.xml
M +11 -9 rkward/plugins/plots/density_plot.js
M +4 -4 rkward/plugins/plots/dotchart.js
M +4 -1 rkward/plugins/plots/ecdf_plot.js
M +2 -11 rkward/plugins/plots/histogram.js
M +14 -25 rkward/plugins/plots/histogram_options.js
M +3 -3 rkward/plugins/plots/pareto.js
M +6 -6 rkward/plugins/plots/piechart.js
M +1 -2 rkward/plugins/plots/plot.js
M +9 -12 rkward/plugins/plots/scatterplot.js
M +2 -2 rkward/plugins/plots/scatterplot_matrix.js
M +2 -2 rkward/plugins/plots/scatterplot_matrix.xml
M +3 -18 rkward/plugins/plots/sieve_plot.js
M +5 -2 rkward/plugins/plots/stem.js
M +3 -3 rkward/plugins/plots/stem.xml
M +9 -6 rkward/plugins/plots/stripchart_plot.js
M +1 -1 rkward/plugins/plots/stripchart_plot.xml
M +9 -0 rkward/scriptbackends/common.js
M +9 -9 tests/plots/boxplot.rkcommands.R
M +8 -6 tests/plots/boxplot_grouped.rkcommands.R
M +7 -1 tests/plots/density_plot.rkcommands.R
M +7 -14 tests/plots/density_plot.rkout
M +3 -1 tests/plots/ecdf_plot.rkcommands.R
M +8 -1 tests/plots/histogram.rkcommands.R
M +13 -18 tests/plots/histogram.rkout
M +4 -5 tests/plots/scatterplot.rkcommands.R
M +4 -1 tests/plots/scatterplot_matrix.rkcommands.R
M +4 -4 tests/plots/scatterplot_matrix.rkout
M +4 -2 tests/plots/stem_leaf_plot.rkcommands.R
M +2 -2 tests/plots/stem_leaf_plot.rkout
M +5 -1 tests/plots/stripchart.rkcommands.R
M +2 -2 tests/plots/stripchart.rkout
http://commits.kde.org/rkward/3ff25b6103822af2becadbb456428d852b666fd4
diff --git a/rkward/plugins/plots/barplot.js b/rkward/plugins/plots/barplot.js
index 9174709..ed00f8c 100644
--- a/rkward/plugins/plots/barplot.js
+++ b/rkward/plugins/plots/barplot.js
@@ -11,7 +11,7 @@ function doPrintout (full) {
var names_mode = getValue ("names_mode");
var tabulate = getValue ("tabulate.checked");
- var main_header = '"Variable"=rk.get.description (' + varname + ')';
+ var main_header = i18n ("Variable") + '=rk.get.description (' + varname + ')';
if (tabulate) main_header = getValue ('tabulate_options.parameters');
var limit = getValue ("limit.checked");
@@ -26,7 +26,7 @@ function doPrintout (full) {
echo (getValue ('tabulate_options.code.calculate'));
} else {
echo ('x <- ' + varname + "\n");
- echo ('# barplot is a bit picky about attributes, so we need to convert to vector explicitely\n');
+ comment ('barplot is a bit picky about attributes, so we need to convert to vector explicitely');
echo ('if(!is.matrix(x)) x <- as.vector(x)\n');
echo ('if(!is.matrix(x) && is.data.frame(x)) x <- data.matrix(x)\n');
}
@@ -42,7 +42,7 @@ function doPrintout (full) {
}
if (full) {
- echo ('rk.header ("Barplot", parameters=list (' + main_header + limit_header + barplot_header + '))\n');
+ echo ('rk.header (' + i18n ("Barplot") + ', parameters=list (' + main_header + limit_header + barplot_header + '))\n');
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/barplot_embed.js b/rkward/plugins/plots/barplot_embed.js
index cf4963d..3985d07 100644
--- a/rkward/plugins/plots/barplot_embed.js
+++ b/rkward/plugins/plots/barplot_embed.js
@@ -49,7 +49,7 @@ function printout () {
echo (plot_pre);
if (options['labels']) {
- echo ('# adjust the range so that the labels will fit\n');
+ comment ('adjust the range so that the labels will fit');
echo ('yrange <- range (' + options['xvar'] + ', na.rm=TRUE) * 1.2\n');
echo ('if (yrange[1] > 0) yrange[1] <- 0\n');
echo ('if (yrange[2] < 0) yrange[2] <- 0\n');
diff --git a/rkward/plugins/plots/box_plot.js b/rkward/plugins/plots/box_plot.js
index f8906af..1a6bdae 100644
--- a/rkward/plugins/plots/box_plot.js
+++ b/rkward/plugins/plots/box_plot.js
@@ -27,9 +27,9 @@ function doPrintout (full) {
var dodges = groups_a.slice (0, n_dodges);
var groups = groups_a.slice (n_dodges);
echo ('groups <- rk.list (' + dodges.concat (groups).join (", ") + ')\n');
- echo ('data_list <- split (' + getValue ("outcome") + ', groups) #split sample by grouping variables\n');
+ echo ('data_list <- split (' + getValue ("outcome") + ', groups) '); comment ('split sample by grouping variables');
if (dodged) {
- echo ('# adjust width and position of boxes to achieve dodging\n');
+ comment ('adjust width and position of boxes to achieve dodging');
echo ('dodge_size <- nlevels (interaction (' + dodges.join (", ") + '))\n');
echo ('box_width <- ' + getValue ("boxwex") + ' / dodge_size\n');
boxwex = ', boxwex=box_width';
@@ -37,7 +37,7 @@ function doPrintout (full) {
positions = ', at=box_positions, xlim=c(min(box_positions)-box_width, max(box_positions)+box_width)';
}
} else {
- echo ('data_list <- rk.list (' + getValue ("x").split ("\n").join (", ") + ') #convert single sample variables to list\n');
+ echo ('data_list <- rk.list (' + getValue ("x").split ("\n").join (", ") + ') '); comment ('convert single sample variables to list');
}
if (names_mode == "rexp") {
echo ("names(data_list) <- " + getValue ("names_exp") + "\n");
@@ -47,9 +47,9 @@ function doPrintout (full) {
if (full) {
if (grouped_mode) {
- echo ('rk.header ("Boxplot", list ("Outcome variable", rk.get.description (' + getValue ("outcome") + '), "Grouping variable(s)", paste (names (groups), collapse=", ")))\n');
+ new Header (i18n ("Boxplot")).add (i18n ("Outcome variable"), noquote ('rk.get.description (' + getValue ("outcome") + ')')).add (i18n ("Grouping variable(s)"), noquote ("paste (names (groups), collapse=\", \")")).print ();
} else {
- echo ('rk.header ("Boxplot", list ("Variable(s)", paste (names (data_list), collapse=", ")))\n');
+ new Header (i18n ("Boxplot")).add (i18n ("Variable(s)"), noquote ("paste (names (data_list), collapse=\", \")")).print ();
}
echo ('rk.graph.on()\n');
}
@@ -57,17 +57,17 @@ function doPrintout (full) {
echo ('try ({\n');
printIndentedUnlessEmpty ("\t", getValue ("plotoptions.code.preprocess"), '', '\n');
- echo (' boxplot (data_list' + boxwex + positions + ', notch = ' + getValue ("notch") + ', outline = ' + getValue("outline") + ', horizontal = ' + getValue("orientation") + getValue ("plotoptions.code.printout") + ') #actual boxplot function\n');
+ echo (' boxplot (data_list' + boxwex + positions + ', notch = ' + getValue ("notch") + ', outline = ' + getValue("outline") + ', horizontal = ' + getValue("orientation") + getValue ("plotoptions.code.printout") + ') '); comment ("actual boxplot function");
if (do_mean) {
var mean_fun = "mean, na.rm=TRUE";
if (getValue ("type_of_mean") =="geometric_mean") {
- echo(' geo_mean <- function (x) {prod(na.omit(x))^(1/length(na.omit(x)))} #Calculate geometric mean\n');
+ echo(' geo_mean <- function (x) {prod(na.omit(x))^(1/length(na.omit(x)))} '); comment ('Calculate geometric mean');
mean_fun = "geo_mean";
} else if (getValue ("type_of_mean") =="harmonic_mean") {
- echo(' har_mean <- function (x) {(1 / mean(1 / na.omit(x)))} #Calculate harmonic mean\n');
+ echo(' har_mean <- function (x) {(1 / mean(1 / na.omit(x)))} '); comment ('Calculate harmonic mean');
mean_fun = "har_mean";
} else if (getValue ("type_of_mean") =="interquartile_mean") {
- echo(' interq_mean <- function (x) {sum(quantile(x, probs=c(0.25), na.rm=TRUE), quantile(x, probs=c(0.75), na.rm=TRUE)) / 2} #Calculate the interquartile mean\n');
+ echo(' interq_mean <- function (x) {sum(quantile(x, probs=c(0.25), na.rm=TRUE), quantile(x, probs=c(0.75), na.rm=TRUE)) / 2} '); comment ('Calculate the interquartile mean');
mean_fun = "interq_mean";
} else { // arithmetic mean
var trimp = getValue("trim"); // NOTE: avoid name clash with utility function trim()!
@@ -75,9 +75,9 @@ function doPrintout (full) {
}
if (horizontal) {
- echo (' points(1:length(data_list) ~ sapply(data_list, ' + mean_fun + '), pch=' + pch_mean + ', cex = ' + getValue ("cex_sd_mean") + getValue ("sd_mean_color.code.printout") + ') #calculates the mean for all data and adds a point at the corresponding position\n');
+ echo (' points(1:length(data_list) ~ sapply(data_list, ' + mean_fun + '), pch=' + pch_mean + ', cex = ' + getValue ("cex_sd_mean") + getValue ("sd_mean_color.code.printout") + ') '); comment ('calculates the mean for all data and adds a point at the corresponding position');
} else {
- echo (' points(sapply(data_list, ' + mean_fun + '), pch=' + pch_mean + ', cex = ' + getValue ("cex_sd_mean") + getValue ("sd_mean_color.code.printout") + ') #calculates the mean for all data and adds a point at the corresponding position\n');
+ echo (' points(sapply(data_list, ' + mean_fun + '), pch=' + pch_mean + ', cex = ' + getValue ("cex_sd_mean") + getValue ("sd_mean_color.code.printout") + ') '); comment ('calculates the mean for all data and adds a point at the corresponding position');
}
}
diff --git a/rkward/plugins/plots/cor_graph.js b/rkward/plugins/plots/cor_graph.js
index ea70b95..47abc3a 100644
--- a/rkward/plugins/plots/cor_graph.js
+++ b/rkward/plugins/plots/cor_graph.js
@@ -37,7 +37,7 @@ function doPrintout (full) {
echo ('\n');
if (full) {
- echo ('rk.header ("Correlation Matrix Plot", parameters=list ("Method", "' + getValue ("method") + '", "Exclusion", "' + getValue ("use") + '", "Precision", "' + getValue ("digits") + ' digits", "Scale text", "' + getValue ("scale") + '"))\n');
+ new Header (i18n ("Correlation Matrix Plot")).addFromUI ("method").addFromUI ("use").addFromUI ("digits").addFromUI ("scale").print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
@@ -48,7 +48,7 @@ function doPrintout (full) {
if (full) {
echo ('rk.graph.off ()\n');
echo ('\n');
- echo ('rk.print("Legend:\\t\'***\': p < 0.001 -- \'**\': p < 0.01 -- \'*\': p < 0.05 -- \'.\'\': p < 0.1")\n');
+ echo ('rk.print(' + i18n ("Legend:") + '\\t\'***\': p < 0.001 -- \'**\': p < 0.01 -- \'*\': p < 0.05 -- \'.\'\': p < 0.1")\n');
}
}
diff --git a/rkward/plugins/plots/cor_graph.xml b/rkward/plugins/plots/cor_graph.xml
index 5bde111..99995a0 100644
--- a/rkward/plugins/plots/cor_graph.xml
+++ b/rkward/plugins/plots/cor_graph.xml
@@ -3,12 +3,12 @@
<code file="cor_graph.js" />
<help file="cor_graph.rkh" />
- <dialog label="Correlation Matrix Plot" >
+ <dialog label="Correlation Matrix Plot" >
<tabbook>
<tab label="Variables" id="tab_variables">
<row>
<varselector id="vars"/>
- <column>
+ <column>
<varslot type="numeric" min_vars="1" multi="true" id="x" source="vars" required="true" label="variable(s):"/>
<preview id="preview"/>
</column>
@@ -24,7 +24,7 @@
<option value="complete.obs" label="whole cases"/>
<option value="pairwise.complete.obs" label="pairwise" checked="true"/>
</radio>
- <spinbox id="digits" label="Precision" type="integer" min="0" max="5" initial="3"/>
+ <spinbox id="digits" label="Precision (digits)" type="integer" min="0" max="5" initial="3"/>
<checkbox id="scale" label="Scale text" value="TRUE" value_unchecked="FALSE" checked="true"><!-- i18n: Should text be scaled? --></checkbox>
</tab>
</tabbook>
diff --git a/rkward/plugins/plots/density_plot.js b/rkward/plugins/plots/density_plot.js
index 3b0334e..f619c49 100644
--- a/rkward/plugins/plots/density_plot.js
+++ b/rkward/plugins/plots/density_plot.js
@@ -36,17 +36,19 @@ function doPrintout (full) {
density_call += ", adjust=" + adjust + ", kern=\"" + kern + "\", n=" + resolution + ", " + narm + ")";
var title = "";
- if (dodensity_plot) title = "Density Plot";
- else title = "Highest density regions";
+ if (dodensity_plot) title = i18n ("Density Plot");
+ else title = i18n ("Highest density regions");
if (full) {
- echo ('rk.header ("' + title + '", list ("Variable", rk.get.description (' + x + ')');
- if (bw != "") {
- echo (', "Band Width", "');
- echo (bw);
- echo ('"');
- }
- echo (', "Adjust", ' + adjust + ', "Remove Missing Values", ' + narm + ', "Length", length (' + x + '), "Resolution", ' + resolution + ', "Smoothing Kernel", "' + kern + '"))\n');
+ header = new Header (title);
+ header.add (i18n ("Variable"), noquote ('rk.get.description (' + x + ')'));
+ header.add (i18n ("Length"), noquote ('length (' + x + ')'));
+ header.addFromUI ("adjust");
+ header.addFromUI ("narm");
+ header.addFromUI ("n");
+ header.addFromUI ("kern");
+ if (bw != "") header.addFromUI ("bw");
+ header.print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/dotchart.js b/rkward/plugins/plots/dotchart.js
index c33fc79..35dd9ae 100644
--- a/rkward/plugins/plots/dotchart.js
+++ b/rkward/plugins/plots/dotchart.js
@@ -11,7 +11,7 @@ function doPrintout (full) {
var names_mode = getValue ("names_mode");
var tabulate = getValue ("tabulate.checked");
- var main_header = '"Variable"=rk.get.description (' + vars + ')';
+ var main_header = i18n ("Variable") + '=rk.get.description (' + vars + ')';
if (tabulate) main_header = getValue ('tabulate_options.parameters');
var limit = getValue ("limit.checked");
@@ -22,11 +22,11 @@ function doPrintout (full) {
if (tabulate) {
echo (getValue ('tabulate_options.code.calculate'));
- echo ('n <- names (x); x <- as.numeric (x); names (x) <- n # dotchart() is somewhat picky about data type\n');
+ echo ('n <- names (x); x <- as.numeric (x); names (x) <- n '); comment ('dotchart() is somewhat picky about data type');
} else {
echo ('x <- ' + getValue ("x") + '\n');
echo ('if (!is.numeric (x)) {\n');
- echo (' warning ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?")\n');
+ echo (' warning (' + i18n ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?") + ')\n');
echo ('}\n');
}
@@ -36,7 +36,7 @@ function doPrintout (full) {
echo ('\n');
if (full) {
- echo ('rk.header ("Dot chart", parameters=list (' + main_header + limit_header + '))\n');
+ echo ('rk.header (' + i18n ("Dot chart") + ', parameters=list (' + main_header + limit_header + '))\n');
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/ecdf_plot.js b/rkward/plugins/plots/ecdf_plot.js
index 62e4e3b..5c01df0 100644
--- a/rkward/plugins/plots/ecdf_plot.js
+++ b/rkward/plugins/plots/ecdf_plot.js
@@ -21,7 +21,10 @@ function doPrintout (full) {
var x = getValue ("x");
if (full) {
- echo ('rk.header ("Empirical Cumulative Distribution Function", list ("Variable", rk.get.description (' + x + '), "Minimum", yrange[1], "Maximum", yrange[2]))\n');
+ new Header (i18n ("Empirical Cumulative Distribution Function"))
+ .add (i18n ("Variable"), noquote ('rk.get.description (' + x + ')'))
+ .add (i18n ("Minimum"), noquote ("yrange[1]"))
+ .add (i18n ("Maximum"), noquote ("yrange[2]")).print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/histogram.js b/rkward/plugins/plots/histogram.js
index eff6bcb..2334843 100644
--- a/rkward/plugins/plots/histogram.js
+++ b/rkward/plugins/plots/histogram.js
@@ -16,19 +16,10 @@ function doPrintout (full) {
var x = getValue ("x");
if (full) {
- echo ('rk.header ("Histogram", list ("Variable", rk.get.description (' + x + ') ');
+ echo ('rk.header (' + i18n ("Histogram") + ', list (' + i18n ("Variable") + '=rk.get.description (' + x + ')' + getValue ("histogram_opt.code.preprocess") + '))\n');
if ((densityscaled) && getValue ("density")) {
- echo (', "Density bandwidth", "');
- echo (bw);
- echo ('", "Density adjust", ');
- echo (adjust);
- echo (', "Density resolution", ');
- echo (n);
- echo (', "Density Remove missing values", ');
- echo (narm);
- echo (' ');
+ new Header (i18n ("Density curve", 3)).addFromUI ("bw").addFromUI ("adjust").addFromUI ("n").addFromUI ("narm").print ();
}
- echo (' ' + getValue ("histogram_opt.code.preprocess") + '))\n');
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/histogram_options.js b/rkward/plugins/plots/histogram_options.js
index 62bc1f6..afcf73d 100644
--- a/rkward/plugins/plots/histogram_options.js
+++ b/rkward/plugins/plots/histogram_options.js
@@ -6,47 +6,35 @@ var headeroptions;
function makeCodes () {
histcalcoptions = ", breaks=";
histplotoptions = "";
- headeroptions = "";
var varname = getValue ("varname");
var histbreaks = getValue ("histbreaksFunction");
- headeroptions += ', "Break points", "';
+ var header = new Header ();
+ var bp = i18n ("Break points");
if (histbreaks == "cells") {
histcalcoptions += getValue ("histbreaks_ncells");
- headeroptions += 'Approximately ' + getValue ("histbreaks_ncells") + ' cells"';
+ header.add (bp, i18n ("Approximately %1 cells", getValue ("histbreaks_ncells")));
} else if (histbreaks == "int") {
histcalcoptions += "seq (floor (min (" + varname + ", na.rm=TRUE))-0.5, ceiling (max (" + varname + ", na.rm=TRUE))+0.5)";
- headeroptions += 'Integers"';
+ header.add (bp, i18n ("Integers"));
} else if (histbreaks == "vec") {
histcalcoptions += "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" + getValue ("histbreaks_veclength") + ")})(" + varname + ")";
- headeroptions += 'Equally spaced vector of length ' + getValue ("histbreaks_veclength") + '"';
+ header.add (bp, i18n ("Equally spaced vector of length %1", getValue ("histbreaks_veclength")));
} else {
histcalcoptions += "\"" + histbreaks + "\"";
- headeroptions += histbreaks + '"';
+ header.add (bp, histbreaks);
}
- var right = getValue ("rightclosed");
- if (!right) {
- headeroptions += ', "Right closed", "FALSE"';
- histcalcoptions += ", right=FALSE";
- } else {
- headeroptions += ', "Right closed", "TRUE"';
- }
-
- var inclowest = getValue ("include_lowest");
- if (!inclowest) {
- headeroptions += ', "Include in lowest cell", "FALSE"';
- histcalcoptions += ", include.lowest=FALSE";
- } else {
- headeroptions += ', "Include in lowest cell", "TRUE"';
- }
+ if (!getBoolean ("rightclosed")) histcalcoptions += ", right=FALSE";
+ header.addFromUI ("rightclosed");
+ if (!getBoolean ("include_lowest")) histcalcoptions += ", include.lowest=FALSE";
+ header.addFromUI ("include_lowest");
- var freq = getValue ("freq");
- if (!freq) {
+ if (!getBoolean ("freq")) {
histplotoptions += ", freq=FALSE";
- headeroptions += ', "Scale", "Density"';
+ header.add (i18n ("Scale"), i18n ("Density"));
} else {
- headeroptions += ', "Scale", "Frequency"';
+ header.add (i18n ("Scale"), i18n ("Frequency"));
}
var addbars = getValue ("addtoplot");
@@ -74,6 +62,7 @@ function makeCodes () {
if (getValue ("usefillcol")) histfillcol = getValue ("histfillcol.code.printout");
histplotoptions += histbordercol + histfillcol;
+ headeroptions = ", " + header.extractParameters ();
}
function preprocess () {
diff --git a/rkward/plugins/plots/pareto.js b/rkward/plugins/plots/pareto.js
index 3510961..4ed891c 100644
--- a/rkward/plugins/plots/pareto.js
+++ b/rkward/plugins/plots/pareto.js
@@ -7,7 +7,7 @@ function calculate () {
echo ('x <- ' + getValue ("x") + '\n');
echo ('title <- rk.get.description (' + getValue ("x") + ')\n');
echo ('if (!is.numeric (x)) {\n');
- echo (' warning ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?")\n');
+ echo (' warning (' + i18n ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?") + ')\n');
echo ('}\n');
} else {
echo (getValue ('tabulate_options.code.calculate'));
@@ -32,9 +32,9 @@ function doPrintout (full) {
var descriptives = getValue ("descriptives")=="TRUE";
if (full) {
- echo ('rk.header ("Pareto chart", parameters=list (');
+ echo ('rk.header (' + i18n ("Pareto chart") + ', parameters=list (');
if (getValue ("tabulate.checked")) echo (getValue ('tabulate_options.parameters'));
- else echo ('"Variable"=title');
+ else echo (i18n ("Variable") + '=title');
if (getValue ("limit.checked")) echo (', ' + getValue ('limit_options.parameters'));
echo ('))\n');
echo ('\n');
diff --git a/rkward/plugins/plots/piechart.js b/rkward/plugins/plots/piechart.js
index 2b091d8..6b46155 100644
--- a/rkward/plugins/plots/piechart.js
+++ b/rkward/plugins/plots/piechart.js
@@ -10,7 +10,7 @@ function doPrintout (full) {
var vars = getValue ("x");
var tabulate = getValue ("tabulate.checked");
- var main_header = '"Variable"=rk.get.description (' + vars + ')';
+ var main_header = i18n ("Variable") + '=rk.get.description (' + vars + ')';
if (tabulate) main_header = getValue ('tabulate_options.parameters');
var limit = getValue ("limit.checked");
@@ -24,11 +24,11 @@ function doPrintout (full) {
var density_inc = getValue ("density_inc");
var col = getValue ("colors");
var clockwise = getValue ("clockwise");
- var clockwise_header = "";
+ var clockwise_header = ", " + i18n ("Orientation") + '=';
if (clockwise) {
- clockwise_header = ', "Orientation"="Clockwise"';
+ clockwise_header += i18n ("Clockwise");
} else {
- clockwise_header = ', "Orientation"="Counter clockwise"';
+ clockwise_header += i18n ("Counter clockwise");
}
var names_mode = getValue ("names_mode");
@@ -49,7 +49,7 @@ function doPrintout (full) {
} else {
echo ('x <- ' + getValue ("x") + '\n');
echo ('if (!is.numeric (x)) {\n');
- echo (' warning ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?")\n');
+ echo (' warning (' + i18n ("Data is not numeric, but proceeding as requested.\\nDid you forget to check the tabulate option?") + ')\n');
echo ('}\n');
}
@@ -59,7 +59,7 @@ function doPrintout (full) {
echo ('\n');
if (full) {
- echo ('rk.header ("Pie chart", parameters=list (' + main_header + limit_header + clockwise_header + '))\n');
+ echo ('rk.header (' + i18n ("Pie chart") + ', parameters=list (' + main_header + limit_header + clockwise_header + '))\n');
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/plot.js b/rkward/plugins/plots/plot.js
index 1bc6f34..23a7f23 100644
--- a/rkward/plugins/plots/plot.js
+++ b/rkward/plugins/plots/plot.js
@@ -14,8 +14,7 @@ function doPrintout (full) {
}
if (full) {
-
- echo ('rk.header ("Generic Plot")\n');
+ new Header (i18n ("Generic Plot")).print ();
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/scatterplot.js b/rkward/plugins/plots/scatterplot.js
index 84b6dc1..6e5ccbe 100644
--- a/rkward/plugins/plots/scatterplot.js
+++ b/rkward/plugins/plots/scatterplot.js
@@ -1,9 +1,6 @@
-var x;
-var y;
-
function calculate () {
- x = str_replace ("\n", ",", trim (getValue ("x"))) ;
- y = str_replace ("\n", ",", trim (getValue ("y"))) ;
+ var x = getList ("x").join (",");
+ var y = getList ("y").join (",");
var type = "";
if (getValue ("manual_type.numeric")) {
@@ -16,16 +13,16 @@ function calculate () {
var cex = getValue ("cex");
// input
- echo ('Xvars <- list(' + x + ')\n');
- echo ('Yvars <- list(' + y + ')\n');
+ echo ('Xvars <- rk.list(' + x + ')\n');
+ echo ('Yvars <- rk.list(' + y + ')\n');
echo ('\n');
// verification (is this needed?) ?>
echo ('if (length(Xvars) != length(Yvars)) {\n');
- echo (' stop("Unequal number of X and Y variables given")\n');
+ echo (' stop(' + i18n ("Unequal number of X and Y variables given") + ')\n');
echo ('}\n');
- echo ('# find range of X/Y values needed\n');
+ comment ('find range of X/Y values needed');
echo ('Xrange <- range (c (Xvars), na.rm=TRUE)\n');
echo ('Yrange <- range (c (Yvars), na.rm=TRUE)\n');
echo ('\n');
@@ -46,9 +43,9 @@ function preview () {
function doPrintout (full) {
if (full) {
- echo ('rk.header ("Scatterplot", parameters = list (\n');
- echo (' "X variables"=paste (rk.get.description (' + x + '), collapse=", "),\n');
- echo (' "Y variables"=paste (rk.get.description (' + y + '), collapse=", ")))\n');
+ new Header (i18n ("Scatterplot"))
+ .add (i18n ("X variables"), noquote ('paste (names (Xvars), collapse=", ")'))
+ .add (i18n ("Y variables"), noquote ('paste (names (Yvars), collapse=", ")')).print ();
echo ('\n');
echo ('rk.graph.on()\n');
echo ('\n');
diff --git a/rkward/plugins/plots/scatterplot_matrix.js b/rkward/plugins/plots/scatterplot_matrix.js
index 1294a2f..653009a 100644
--- a/rkward/plugins/plots/scatterplot_matrix.js
+++ b/rkward/plugins/plots/scatterplot_matrix.js
@@ -13,12 +13,12 @@ function preview () {
}
function doPrintout (full) {
- var vars = trim (getValue ("x")).replace (/\n/g, ",");
+ var vars = getList ("x").join (",");
echo ('data <- data.frame (' + vars + ')\n');
echo ('\n');
if (full) {
- echo ('rk.header ("Scatterplot Matrix", parameters=list ("Diagonal Panels", "' + getValue("diag") + '", "Plot points", "' + getValue ("plot_points") + '", "Smooth", "' + getValue ("smooth") + '", "Ellipses", "' + getValue ("ellipse") + ' at 0.5 and 0.9 levels."))\n');
+ new Header (i18n ("Scatterplot Matrix")).addFromUI ("diag").addFromUI ("plot_points").addFromUI ("smooth").addFromUI ("ellipse").print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/scatterplot_matrix.xml b/rkward/plugins/plots/scatterplot_matrix.xml
index edc9502..ae39ddc 100644
--- a/rkward/plugins/plots/scatterplot_matrix.xml
+++ b/rkward/plugins/plots/scatterplot_matrix.xml
@@ -23,8 +23,8 @@
<option value="none" label="No plot"/>
</radio>
<checkbox id="plot_points" label="Plot points" value="TRUE" value_unchecked="FALSE" checked="true"/>
- <checkbox id="smooth" label="Smooth" value="TRUE" value_unchecked="FALSE" checked="false"/>
- <checkbox id="ellipse" label="Ellipse" value="TRUE" value_unchecked="FALSE" checked="false"/>
+ <checkbox id="smooth" label="Plot smooth" value="TRUE" value_unchecked="FALSE" checked="false"/>
+ <checkbox id="ellipse" label="Plot data concentration ellipses" value="TRUE" value_unchecked="FALSE" checked="false"/>
</tab>
</tabbook>
</dialog>
diff --git a/rkward/plugins/plots/sieve_plot.js b/rkward/plugins/plots/sieve_plot.js
index b188f68..553d753 100644
--- a/rkward/plugins/plots/sieve_plot.js
+++ b/rkward/plugins/plots/sieve_plot.js
@@ -1,19 +1,7 @@
-/* ------- This file generated by php2js from PHP code. --------
-Please check this file by hand, and remove this notice, afterwards.
-Messages:
-Note: Control statement without braces. This is bad style.
-Note: Control statement without braces. This is bad style.
-
----------------------------- */
-
-// globals
-var undefined;
-
function preprocess () {
echo ('require(vcd)\n');
}
-
function printout () {
doPrintout (true);
}
@@ -27,12 +15,10 @@ function doPrintout (full) {
var vars = getValue ("x");
var shade = getValue ("shade");
var sievetype = getValue ("sievetype");
- {
- echo ('x <- ' + vars);
- }
- echo ('\n');
+
+ echo ('x <- ' + vars + '\n');
if (full) {
- echo ('rk.header ("Extended Sieve Plot", parameters=list ("Variable", rk.get.description (' + vars + '), "shade", ' + shade + '))\n');
+ new Header (i18n ("Extended Sieve Plot")).add (i18n ("Variable"), noquote ('rk.get.description (' + vars + ')')).addFromUI ("shade").print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
@@ -48,4 +34,3 @@ function doPrintout (full) {
echo ('rk.graph.off ()\n');
}
}
-
diff --git a/rkward/plugins/plots/stem.js b/rkward/plugins/plots/stem.js
index a138660..59b87ad 100644
--- a/rkward/plugins/plots/stem.js
+++ b/rkward/plugins/plots/stem.js
@@ -4,8 +4,11 @@ function printout () {
var width = getValue ("width");
var atom = getValue ("atom");
- echo ('rk.header ("Stem-and-Leaf Plot",\n');
- echo (' parameters=list ("Variable", paste (rk.get.description (' + x + ')), "Plot Length", "' + scale + '","Plot Width", "' + width + '", "Tolerance", "' + atom + '"))\n');
+ new Header (i18n ("Stem-and-Leaf Plot"))
+ .add (i18n ("Variable"), noquote ('paste (rk.get.description (' + x + '))'))
+ .addFromUI ("scale")
+ .addFromUI ("width")
+ .addFromUI ("atom").print ();
echo ('\n');
echo ('rk.print.literal(capture.output(stem(' + x + ', scale = ' + scale + ', width = ' + width + ', atom = ' + atom + ')))\n');
}
diff --git a/rkward/plugins/plots/stem.xml b/rkward/plugins/plots/stem.xml
index ab32e77..066ece4 100644
--- a/rkward/plugins/plots/stem.xml
+++ b/rkward/plugins/plots/stem.xml
@@ -15,9 +15,9 @@
</row>
</tab>
<tab id="tab_options" label="Options">
- <spinbox type="real" id="scale" label="scale" initial="1"/>
- <spinbox type="real" id="width" label="width" initial="80"/>
- <spinbox type="real" id="atom" label="atom" initial="0.00000001"/>
+ <spinbox type="real" id="scale" label="Plot length (scale)" initial="1"/>
+ <spinbox type="real" id="width" label="Plot width" initial="80"/>
+ <spinbox type="real" id="atom" label="Tolerance" initial="0.00000001"/>
</tab>
</tabbook>
</dialog>
diff --git a/rkward/plugins/plots/stripchart_plot.js b/rkward/plugins/plots/stripchart_plot.js
index 7a5610a..e7027da 100644
--- a/rkward/plugins/plots/stripchart_plot.js
+++ b/rkward/plugins/plots/stripchart_plot.js
@@ -8,22 +8,25 @@ function preview () {
function doPrintout (full) {
var opts = "";
- var params = "";
var x = getValue ("x");
var g = getValue ("g");
var method = '"' + getValue ("method") + '"';
if (method == "\"jitter\"") {
opts += ", jitter = " + getValue ("jitter");
- params += ", \"Jitter\" = " + getValue ("jitter");
} else if (method == "\"stack\"") {
opts += ", offset = " + getValue ("offset");
- params += ", \"Offset\" = " + getValue ("offset");
}
- var orientation = getValue ("orientation");
- if (orientation == "Vertical") opts += ", vertical = TRUE";
+ if (getValue ("orientation") == "Vertical") opts += ", vertical = TRUE";
if (full) {
- echo ('rk.header ("Stripchart", list ("Variable"=rk.get.description (' + x + '), "Group"=rk.get.description (' + g + '), "Method"=' + method + params + ', "Orientation"="' + orientation + '"))\n');
+ header = new Header (i18n ("Stripchart"))
+ .add (i18n ("Variable"), noquote ('rk.get.description (' + x + ')'))
+ .add (i18n ("Group"), noquote ('rk.get.description (' + g + ')'))
+ .addFromUI ("method");
+ if (method == "\"jitter\"") header.addFromUI ("jitter");
+ else if (method == "\"stack\"") header.addFromUI ("offset");
+ header.addFromUI ("orientation");
+ header.print ();
echo ('\n');
echo ('rk.graph.on ()\n');
}
diff --git a/rkward/plugins/plots/stripchart_plot.xml b/rkward/plugins/plots/stripchart_plot.xml
index 865a1b4..6e751a2 100644
--- a/rkward/plugins/plots/stripchart_plot.xml
+++ b/rkward/plugins/plots/stripchart_plot.xml
@@ -36,7 +36,7 @@
<option value="stack" label="Stack"/>
</radio>
<spinbox label="Jitter" id="jitter" initial="0.1" />
- <spinbox label="offset" id="offset" initial="0.33333333333" />
+ <spinbox label="Offset" id="offset" initial="0.33333333333" />
<stretch/>
</column>
<column>
diff --git a/rkward/scriptbackends/common.js b/rkward/scriptbackends/common.js
index d3c30e6..bc2e4ca 100644
--- a/rkward/scriptbackends/common.js
+++ b/rkward/scriptbackends/common.js
@@ -124,6 +124,15 @@ Header = function (title, level) {
this.print = function (indentation) {
makeHeaderCode (this.title, this.parameters, this.level, indentation);
}
+ this.extractParameters = function (indentation) {
+ if (typeof (indentation) == 'undefined') indentation = "";
+ var ret = "";
+ for (var p = 0; p < this.parameters.length; p += 2) {
+ if (p) ret += ",\n" + indentation + "\t";
+ ret += quote (this.parameters[p]) + "=" + quote (this.parameters[p+1]);
+ }
+ return ret;
+ }
}
getValue = function (id) {
diff --git a/tests/plots/boxplot.rkcommands.R b/tests/plots/boxplot.rkcommands.R
index b3eda95..54a4627 100644
--- a/tests/plots/boxplot.rkcommands.R
+++ b/tests/plots/boxplot.rkcommands.R
@@ -1,23 +1,23 @@
local({
## Print result
-data_list <- rk.list (women[["weight"]], women[["height"]]) #convert single sample variables to list
-rk.header ("Boxplot", list ("Variable(s)", paste (names (data_list), collapse=", ")))
+data_list <- rk.list (women[["weight"]], women[["height"]]) # convert single sample variables to list
+rk.header ("Boxplot", parameters=list("Variable(s)"=paste (names (data_list), collapse=", ")))
rk.graph.on()
try ({
- boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE) #actual boxplot function
- points(sapply(data_list, mean, na.rm=TRUE), pch=15, cex = 1.00, col="blue") #calculates the mean for all data and adds a point at the corresponding position
+ boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE) # actual boxplot function
+ points(sapply(data_list, mean, na.rm=TRUE), pch=15, cex = 1.00, col="blue") # calculates the mean for all data and adds a point at the corresponding position
})
rk.graph.off ()
})
local({
## Print result
-data_list <- rk.list (women[["weight"]], women[["height"]]) #convert single sample variables to list
-rk.header ("Boxplot", list ("Variable(s)", paste (names (data_list), collapse=", ")))
+data_list <- rk.list (women[["weight"]], women[["height"]]) # convert single sample variables to list
+rk.header ("Boxplot", parameters=list("Variable(s)"=paste (names (data_list), collapse=", ")))
rk.graph.on()
try ({
- boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE) #actual boxplot function
- geo_mean <- function (x) {prod(na.omit(x))^(1/length(na.omit(x)))} #Calculate geometric mean
- points(sapply(data_list, geo_mean), pch=15, cex = 1.00, col="blue") #calculates the mean for all data and adds a point at the corresponding position
+ boxplot (data_list, notch = FALSE, outline = TRUE, horizontal = FALSE) # actual boxplot function
+ geo_mean <- function (x) {prod(na.omit(x))^(1/length(na.omit(x)))} # Calculate geometric mean
+ points(sapply(data_list, geo_mean), pch=15, cex = 1.00, col="blue") # calculates the mean for all data and adds a point at the corresponding position
sd_low <- (sapply(data_list, mean, na.rm = TRUE)) - (sapply(data_list,sd,na.rm = TRUE))
sd_high <- (sapply(data_list, mean, na.rm = TRUE)) + (sapply(data_list,sd,na.rm = TRUE))
points(sd_low, pch=3, cex = 1.00, col="blue")
diff --git a/tests/plots/boxplot_grouped.rkcommands.R b/tests/plots/boxplot_grouped.rkcommands.R
index fb32a93..78ce053 100644
--- a/tests/plots/boxplot_grouped.rkcommands.R
+++ b/tests/plots/boxplot_grouped.rkcommands.R
@@ -1,26 +1,28 @@
local({
## Print result
groups <- rk.list (warpbreaks[["tension"]], warpbreaks[["wool"]])
-data_list <- split (warpbreaks[["breaks"]], groups) #split sample by grouping variables
-rk.header ("Boxplot", list ("Outcome variable", rk.get.description (warpbreaks[["breaks"]]), "Grouping variable(s)", paste (names (groups), collapse=", ")))
+data_list <- split (warpbreaks[["breaks"]], groups) # split sample by grouping variables
+rk.header ("Boxplot", parameters=list("Outcome variable"=rk.get.description (warpbreaks[["breaks"]]),
+ "Grouping variable(s)"=paste (names (groups), collapse=", ")))
rk.graph.on()
try ({
- boxplot (data_list, notch = FALSE, outline = FALSE, horizontal = TRUE) #actual boxplot function
+ boxplot (data_list, notch = FALSE, outline = FALSE, horizontal = TRUE) # actual boxplot function
})
rk.graph.off ()
})
local({
## Print result
groups <- rk.list (warpbreaks[["tension"]], warpbreaks[["wool"]])
-data_list <- split (warpbreaks[["breaks"]], groups) #split sample by grouping variables
+data_list <- split (warpbreaks[["breaks"]], groups) # split sample by grouping variables
# adjust width and position of boxes to achieve dodging
dodge_size <- nlevels (interaction (warpbreaks[["tension"]]))
box_width <- 0.80 / dodge_size
box_positions <- (rep (1:(length (data_list) / dodge_size), each=dodge_size) + (1:dodge_size)*(box_width))
-rk.header ("Boxplot", list ("Outcome variable", rk.get.description (warpbreaks[["breaks"]]), "Grouping variable(s)", paste (names (groups), collapse=", ")))
+rk.header ("Boxplot", parameters=list("Outcome variable"=rk.get.description (warpbreaks[["breaks"]]),
+ "Grouping variable(s)"=paste (names (groups), collapse=", ")))
rk.graph.on()
try ({
- boxplot (data_list, boxwex=box_width, at=box_positions, xlim=c(min(box_positions)-box_width, max(box_positions)+box_width), notch = FALSE, outline = FALSE, horizontal = TRUE) #actual boxplot function
+ boxplot (data_list, boxwex=box_width, at=box_positions, xlim=c(min(box_positions)-box_width, max(box_positions)+box_width), notch = FALSE, outline = FALSE, horizontal = TRUE) # actual boxplot function
})
rk.graph.off ()
})
diff --git a/tests/plots/density_plot.rkcommands.R b/tests/plots/density_plot.rkcommands.R
index 41b0e96..4e2e24e 100644
--- a/tests/plots/density_plot.rkcommands.R
+++ b/tests/plots/density_plot.rkcommands.R
@@ -2,7 +2,13 @@ local({
## Prepare
require(hdrcde)
## Print result
-rk.header ("Highest density regions", list ("Variable", rk.get.description (women[["height"]]), "Band Width", "nrd0", "Adjust", 1.00, "Remove Missing Values", na.rm=TRUE, "Length", length (women[["height"]]), "Resolution", 512.00, "Smoothing Kernel", "gaussian"))
+rk.header ("Highest density regions", parameters=list("Variable"=rk.get.description (women[["height"]]),
+ "Length"=length (women[["height"]]),
+ "Adjust Bandwidth"="1.00",
+ "Remove Missing Values"="yes",
+ "Resolution"="512.00",
+ "Smoothing Kernel"="gaussian (default)",
+ "Bandwidth"="nrd0"))
rk.graph.on ()
try ({
diff --git a/tests/plots/density_plot.rkout b/tests/plots/density_plot.rkout
index 43802f5..97a620d 100644
--- a/tests/plots/density_plot.rkout
+++ b/tests/plots/density_plot.rkout
@@ -1,19 +1,12 @@
<h1>Highest density regions</h1>
<h2>Parameters</h2>
-<ul><li>: Variable</li>
-<li>: height</li>
-<li>: Band Width</li>
-<li>: nrd0</li>
-<li>: Adjust</li>
-<li>: 1</li>
-<li>: Remove Missing Values</li>
-<li>na.rm: TRUE</li>
-<li>: Length</li>
-<li>: 15</li>
-<li>: Resolution</li>
-<li>: 512</li>
-<li>: Smoothing Kernel</li>
-<li>: gaussian</li>
+<ul><li>Variable: height</li>
+<li>Length: 15</li>
+<li>Adjust Bandwidth: 1.00</li>
+<li>Remove Missing Values: yes</li>
+<li>Resolution: 512.00</li>
+<li>Smoothing Kernel: gaussian (default)</li>
+<li>Bandwidth: nrd0</li>
</ul>
DATE<br />
<img src="graph.png" width="480" height="480"><br>
diff --git a/tests/plots/ecdf_plot.rkcommands.R b/tests/plots/ecdf_plot.rkcommands.R
index a95343e..6e92a6e 100644
--- a/tests/plots/ecdf_plot.rkcommands.R
+++ b/tests/plots/ecdf_plot.rkcommands.R
@@ -4,7 +4,9 @@ yrange <- range (swiss[["Catholic"]], na.rm=TRUE)
data.mean <- mean (swiss[["Catholic"]], na.rm=TRUE)
data.sd <- sd (swiss[["Catholic"]], na.rm=TRUE)
## Print result
-rk.header ("Empirical Cumulative Distribution Function", list ("Variable", rk.get.description (swiss[["Catholic"]]), "Minimum", yrange[1], "Maximum", yrange[2]))
+rk.header ("Empirical Cumulative Distribution Function", parameters=list("Variable"=rk.get.description (swiss[["Catholic"]]),
+ "Minimum"=yrange[1],
+ "Maximum"=yrange[2]))
rk.graph.on ()
try ({
diff --git a/tests/plots/histogram.rkcommands.R b/tests/plots/histogram.rkcommands.R
index ea012b1..27e11f7 100644
--- a/tests/plots/histogram.rkcommands.R
+++ b/tests/plots/histogram.rkcommands.R
@@ -1,6 +1,13 @@
local({
## Print result
-rk.header ("Histogram", list ("Variable", rk.get.description (swiss[["Education"]]) , "Density bandwidth", "nrd", "Density adjust", 4.00, "Density resolution", 512.00, "Density Remove missing values", na.rm=TRUE , "Break points", "Equally spaced vector of length 6", "Right closed", "TRUE", "Include in lowest cell", "TRUE", "Scale", "Density"))
+rk.header ("Histogram", list ("Variable"=rk.get.description (swiss[["Education"]]), "Break points"="Equally spaced vector of length 6",
+ "Right closed"="yes",
+ "Include in lowest cell"="yes",
+ "Scale"="Density"))
+rk.header ("Density curve", parameters=list("Bandwidth"="nrd",
+ "Adjust Bandwidth"="4.00",
+ "resolution"="512.00",
+ "Remove Missing Values"="yes"))
rk.graph.on ()
try ({
diff --git a/tests/plots/histogram.rkout b/tests/plots/histogram.rkout
index a3e1ec5..7f7603c 100644
--- a/tests/plots/histogram.rkout
+++ b/tests/plots/histogram.rkout
@@ -1,23 +1,18 @@
<h1>Histogram</h1>
<h2>Parameters</h2>
-<ul><li>: Variable</li>
-<li>: Education</li>
-<li>: Density bandwidth</li>
-<li>: nrd</li>
-<li>: Density adjust</li>
-<li>: 4</li>
-<li>: Density resolution</li>
-<li>: 512</li>
-<li>: Density Remove missing values</li>
-<li>na.rm: TRUE</li>
-<li>: Break points</li>
-<li>: Equally spaced vector of length 6</li>
-<li>: Right closed</li>
-<li>: TRUE</li>
-<li>: Include in lowest cell</li>
-<li>: TRUE</li>
-<li>: Scale</li>
-<li>: Density</li>
+<ul><li>Variable: Education</li>
+<li>Break points: Equally spaced vector of length 6</li>
+<li>Right closed: yes</li>
+<li>Include in lowest cell: yes</li>
+<li>Scale: Density</li>
+</ul>
+DATE<br />
+<h1>Density curve</h1>
+<h2>Parameters</h2>
+<ul><li>Bandwidth: nrd</li>
+<li>Adjust Bandwidth: 4.00</li>
+<li>resolution: 512.00</li>
+<li>Remove Missing Values: yes</li>
</ul>
DATE<br />
<img src="graph.png" width="480" height="480"><br>
diff --git a/tests/plots/scatterplot.rkcommands.R b/tests/plots/scatterplot.rkcommands.R
index a0a4d55..5eaa175 100644
--- a/tests/plots/scatterplot.rkcommands.R
+++ b/tests/plots/scatterplot.rkcommands.R
@@ -1,7 +1,7 @@
local({
## Compute
-Xvars <- list(women[["weight"]],swiss[["Education"]])
-Yvars <- list(women[["height"]],swiss[["Catholic"]])
+Xvars <- rk.list(women[["weight"]],swiss[["Education"]])
+Yvars <- rk.list(women[["height"]],swiss[["Catholic"]])
if (length(Xvars) != length(Yvars)) {
stop("Unequal number of X and Y variables given")
@@ -15,9 +15,8 @@ col <- rep (c ('black', 'red'), length.out=length (Xvars));
cex <- rep (1, length.out=length (Xvars));
pch <- rep (1, length.out=length (Xvars));
## Print result
-rk.header ("Scatterplot", parameters = list (
- "X variables"=paste (rk.get.description (women[["weight"]],swiss[["Education"]]), collapse=", "),
- "Y variables"=paste (rk.get.description (women[["height"]],swiss[["Catholic"]]), collapse=", ")))
+rk.header ("Scatterplot", parameters=list("X variables"=paste (names (Xvars), collapse=", "),
+ "Y variables"=paste (names (Yvars), collapse=", ")))
rk.graph.on()
diff --git a/tests/plots/scatterplot_matrix.rkcommands.R b/tests/plots/scatterplot_matrix.rkcommands.R
index 207ae19..23a0f05 100644
--- a/tests/plots/scatterplot_matrix.rkcommands.R
+++ b/tests/plots/scatterplot_matrix.rkcommands.R
@@ -4,7 +4,10 @@ require(car)
## Print result
data <- data.frame (swiss)
-rk.header ("Scatterplot Matrix", parameters=list ("Diagonal Panels", "histogram", "Plot points", "TRUE", "Smooth", "FALSE", "Ellipses", "FALSE at 0.5 and 0.9 levels."))
+rk.header ("Scatterplot Matrix", parameters=list("Diagonal panels"="Histogram",
+ "Plot points"="yes",
+ "Plot smooth"="no",
+ "Plot data concentration ellipses"="no"))
rk.graph.on ()
try (scatterplotMatrix(data, diagonal="histogram", plot.points=TRUE, smooth=FALSE, ellipse=FALSE))
diff --git a/tests/plots/scatterplot_matrix.rkout b/tests/plots/scatterplot_matrix.rkout
index 0929c60..07aaaf3 100644
--- a/tests/plots/scatterplot_matrix.rkout
+++ b/tests/plots/scatterplot_matrix.rkout
@@ -1,9 +1,9 @@
<h1>Scatterplot Matrix</h1>
<h2>Parameters</h2>
-<ul><li>Diagonal Panels: histogram</li>
-<li>Plot points: TRUE</li>
-<li>Smooth: FALSE</li>
-<li>Ellipses: FALSE at 0.5 and 0.9 levels.</li>
+<ul><li>Diagonal panels: Histogram</li>
+<li>Plot points: yes</li>
+<li>Plot smooth: no</li>
+<li>Plot data concentration ellipses: no</li>
</ul>
DATE<br />
<img src="graph.png" width="480" height="480"><br>
diff --git a/tests/plots/stem_leaf_plot.rkcommands.R b/tests/plots/stem_leaf_plot.rkcommands.R
index bb7901f..9b4d2b3 100644
--- a/tests/plots/stem_leaf_plot.rkcommands.R
+++ b/tests/plots/stem_leaf_plot.rkcommands.R
@@ -1,7 +1,9 @@
local({
## Print result
-rk.header ("Stem-and-Leaf Plot",
- parameters=list ("Variable", paste (rk.get.description (swiss[["Fertility"]])), "Plot Length", "1.50","Plot Width", "80.00", "Tolerance", "0.01"))
+rk.header ("Stem-and-Leaf Plot", parameters=list("Variable"=paste (rk.get.description (swiss[["Fertility"]])),
+ "Plot length (scale)"="1.50",
+ "Plot width"="80.00",
+ "Tolerance"="0.01"))
rk.print.literal(capture.output(stem(swiss[["Fertility"]], scale = 1.50, width = 80.00, atom = 0.01)))
})
diff --git a/tests/plots/stem_leaf_plot.rkout b/tests/plots/stem_leaf_plot.rkout
index 322abdb..9376b7d 100644
--- a/tests/plots/stem_leaf_plot.rkout
+++ b/tests/plots/stem_leaf_plot.rkout
@@ -1,8 +1,8 @@
<h1>Stem-and-Leaf Plot</h1>
<h2>Parameters</h2>
<ul><li>Variable: Fertility</li>
-<li>Plot Length: 1.50</li>
-<li>Plot Width: 80.00</li>
+<li>Plot length (scale): 1.50</li>
+<li>Plot width: 80.00</li>
<li>Tolerance: 0.01</li>
</ul>
DATE<br />
diff --git a/tests/plots/stripchart.rkcommands.R b/tests/plots/stripchart.rkcommands.R
index d9c34be..4b2b483 100644
--- a/tests/plots/stripchart.rkcommands.R
+++ b/tests/plots/stripchart.rkcommands.R
@@ -1,6 +1,10 @@
local({
## Print result
-rk.header ("Stripchart", list ("Variable"=rk.get.description (warpbreaks[["breaks"]]), "Group"=rk.get.description (warpbreaks[["tension"]]), "Method"="stack", "Offset" = 0.50, "Orientation"="Horizontal"))
+rk.header ("Stripchart", parameters=list("Variable"=rk.get.description (warpbreaks[["breaks"]]),
+ "Group"=rk.get.description (warpbreaks[["tension"]]),
+ "Treatment of identical values"="Stack",
+ "Offset"="0.50",
+ "Orientation"="Horizontal"))
rk.graph.on ()
try ({
diff --git a/tests/plots/stripchart.rkout b/tests/plots/stripchart.rkout
index c2d4a8f..72fb199 100644
--- a/tests/plots/stripchart.rkout
+++ b/tests/plots/stripchart.rkout
@@ -2,8 +2,8 @@
<h2>Parameters</h2>
<ul><li>Variable: breaks</li>
<li>Group: tension</li>
-<li>Method: stack</li>
-<li>Offset: 0.5</li>
+<li>Treatment of identical values: Stack</li>
+<li>Offset: 0.50</li>
<li>Orientation: Horizontal</li>
</ul>
DATE<br />
More information about the rkward-tracker
mailing list