[rkward-cvs] [rkward/work/distributions] rkward/rbackend/rpackages/rkward/R: When printing data.frame through rk.results, make sure to format by column, not by cell.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Jan 22 09:51:37 UTC 2015


Git commit a8138c27ee77fd869bc1ba65c20d5483a5dee40b by Thomas Friedrichsmeier.
Committed on 22/01/2015 at 09:48.
Pushed by tfry into branch 'work/distributions'.

When printing data.frame through rk.results, make sure to format by column, not by cell.
Fixes rounding to different number of digits within a column.

M  +2    -1    rkward/rbackend/rpackages/rkward/R/rk.print-functions.R

http://commits.kde.org/rkward/a8138c27ee77fd869bc1ba65c20d5483a5dee40b

diff --git a/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R b/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
index 88924c4..1506719 100644
--- a/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
+++ b/rkward/rbackend/rpackages/rkward/R/rk.print-functions.R
@@ -193,10 +193,11 @@
 			cat ("</tr>\n")
 	
 			if (is.data.frame (x)) {
+				x <- as.data.frame (lapply (x, format), stringsAsFactors=FALSE)
 				for (row in 1:dim (x)[1]) {
 					cat ("<tr>")
 					for (col in 1:dim (x)[2]) {
-						cat ("<td>", format (x[row, col]), "</td>", sep="")
+						cat ("<td>", x[row, col], "</td>", sep="")
 					}
 					cat ("</tr>\n")
 				}


------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs


More information about the rkward-tracker mailing list