[rkward-cvs] SF.net SVN: rkward:[4312] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Sep 26 10:57:10 UTC 2012


Revision: 4312
          http://rkward.svn.sourceforge.net/rkward/?rev=4312&view=rev
Author:   tfry
Date:     2012-09-26 10:57:09 +0000 (Wed, 26 Sep 2012)
Log Message:
-----------
Fix breakage of pareto table. This required to add a way to suppress printing of dimension names in rk.results()

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/plots/pareto.js
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
    trunk/rkward/tests/plots/pareto_chart.rkcommands.R
    trunk/rkward/tests/plots/pareto_chart.rkout

Modified: trunk/rkward/rkward/plugins/plots/pareto.js
===================================================================
--- trunk/rkward/rkward/plugins/plots/pareto.js	2012-09-26 10:35:46 UTC (rev 4311)
+++ trunk/rkward/rkward/plugins/plots/pareto.js	2012-09-26 10:57:09 UTC (rev 4312)
@@ -48,7 +48,7 @@
 	echo ('\t');
 	if (full && descriptives) echo ('descriptives <- ');
 	echo ('pareto.chart(x' + getValue ("plotoptions.code.printout") + ')\n');
-	if (full && descriptives) echo ('	rk.results(data.frame(descriptives))\n');
+	if (full && descriptives) echo ('	rk.results(descriptives, titles=c(NA,NA))\n');
 
 	printIndentedUnlessEmpty ("\t", getValue ("plotoptions.code.calculate"), '\n', '');
 	echo ('})\n');

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R	2012-09-26 10:35:46 UTC (rev 4311)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R	2012-09-26 10:57:09 UTC (rev 4312)
@@ -158,8 +158,11 @@
 		if (is.null(titles)) {
 			titles <- names(dimnames(x))
 		}
-		rn <- paste (titles[1], "=", dimnames(x)[[1]])
-		titles <- c ("", paste (titles[2], "=", dimnames(x)[[2]]))
+		rn <- dimnames(x)[[1]]
+		if (!is.na (titles[1])) rn <- paste(titles[1], "=", rn)
+		cn <- dimnames(x)[[2]]
+		if (!is.na (titles[2])) cn <- paste(titles[2], "=", cn)
+		titles <- c ("", cn)
 		x <- data.frame (cbind (x), stringsAsFactors=FALSE)
 		rownames (x) <- as.character (rn)
 		if (missing (print.rownames)) print.rownames <- TRUE

Modified: trunk/rkward/tests/plots/pareto_chart.rkcommands.R
===================================================================
--- trunk/rkward/tests/plots/pareto_chart.rkcommands.R	2012-09-26 10:35:46 UTC (rev 4311)
+++ trunk/rkward/tests/plots/pareto_chart.rkcommands.R	2012-09-26 10:57:09 UTC (rev 4312)
@@ -18,7 +18,7 @@
 rk.graph.on ()
 try ({
 	descriptives <- pareto.chart(x, ylab="Frequency", main=title)
-	rk.results(data.frame(descriptives))
+	rk.results(descriptives, titles=c(NA,NA))
 })
 rk.graph.off ()
 })
@@ -35,7 +35,7 @@
 rk.graph.on ()
 try ({
 	descriptives <- pareto.chart(x, ylab="Sum of warpbreaks[[\"breaks\"]]", main=title)
-	rk.results(data.frame(descriptives))
+	rk.results(descriptives, titles=c(NA,NA))
 })
 rk.graph.off ()
 })

Modified: trunk/rkward/tests/plots/pareto_chart.rkout
===================================================================
--- trunk/rkward/tests/plots/pareto_chart.rkout	2012-09-26 10:35:46 UTC (rev 4311)
+++ trunk/rkward/tests/plots/pareto_chart.rkout	2012-09-26 10:57:09 UTC (rev 4312)
@@ -8,14 +8,14 @@
 <tr><td></td><td>Frequency</td><td>Cum.Freq.</td><td>Percentage</td><td>Cum.Percent.</td></tr>
 <tr><td>A</td><td>53</td><td>53</td><td>21.116</td><td>21.116</td></tr>
 <tr><td>B</td><td>32</td><td>85</td><td>12.749</td><td>33.865</td></tr>
-<tr><td>D</td><td>29</td><td>114</td><td>11.554</td><td>45.418</td></tr>
-<tr><td>C</td><td>29</td><td>143</td><td>11.554</td><td>56.972</td></tr>
+<tr><td>C</td><td>29</td><td>114</td><td>11.554</td><td>45.418</td></tr>
+<tr><td>D</td><td>29</td><td>143</td><td>11.554</td><td>56.972</td></tr>
 <tr><td>E</td><td>28</td><td>171</td><td>11.155</td><td>68.127</td></tr>
 <tr><td>F</td><td>20</td><td>191</td><td>7.9681</td><td>76.096</td></tr>
 <tr><td>G</td><td>19</td><td>210</td><td>7.5697</td><td>83.665</td></tr>
 <tr><td>H</td><td>15</td><td>225</td><td>5.9761</td><td>89.641</td></tr>
-<tr><td>J</td><td>13</td><td>238</td><td>5.1793</td><td>94.821</td></tr>
-<tr><td>I</td><td>13</td><td>251</td><td>5.1793</td><td>100</td></tr>
+<tr><td>I</td><td>13</td><td>238</td><td>5.1793</td><td>94.821</td></tr>
+<tr><td>J</td><td>13</td><td>251</td><td>5.1793</td><td>100</td></tr>
 </table>
 
 <h1>Pareto chart</h1>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the rkward-tracker mailing list