[rkward-cvs] SF.net SVN: rkward:[3044] trunk/rkward/rkward/rbackend/rpackages/rkward/R/ public_graphics.R

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Fri Sep 17 07:13:27 UTC 2010


Revision: 3044
          http://rkward.svn.sourceforge.net/rkward/?rev=3044&view=rev
Author:   kapatp
Date:     2010-09-17 07:13:27 +0000 (Fri, 17 Sep 2010)

Log Message:
-----------
clean up again

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-17 06:55:29 UTC (rev 3043)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-17 07:13:27 UTC (rev 3044)
@@ -359,7 +359,7 @@
 			savedPlots [[.st.]]$tlo.ls <<- .unsavedPlot$tlo.ls
 			savedPlots [[.st.]]$call <<- try (.get.oldplot.call (n, .cll, .cstr))
 			.check.other.dev.at.same.pos (devId, n)
-		} else .my.message ("_IS_ identical, so not ckecking for odsp")
+		}
 		invisible (n)
 	}
 	.save.oversized.plot <- function ()
@@ -574,26 +574,11 @@
 	}
 	
 	## Utility / print functions:
-	getDevSummary <- function ()
+## TODO: add these functions to rkh file
+	getDevSummary <- function (devId = NULL)
 	{
-		if (!.rk.rp.debug) return (invisible ())
-		message ('History length   : ', sP.length)
+		message ("History length   : ", sP.length)
 		message ("History size (KB): ", round (object.size (savedPlots) / 1024, 2))
-		.my.hP.print ()
-	}
-	getSavedPlotsSummary <- function ()
-	{
-		.tmp.df <- data.frame (
-			call = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "call"),
-			size.KB  = sapply (lapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "plot"), function (x) object.size(x)/1024),
-			pkg  = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "pkg"),
-			timestamp  = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "time"))
-		rownames (.tmp.df) <- NULL
-		.tmp.df
-	}
-	.my.message <- function (...) if (.rk.rp.debug) message (paste (..., sep = " "))
-	.my.hP.print <- function (devId = NULL) {
-		if (!.rk.rp.debug) return (invisible ())
 		if (is.null (devId)) {
 			.tmp.df <- data.frame (
 				pNew = sapply (histPositions, "[[", "is.this.plot.new"),
@@ -617,10 +602,18 @@
 				pCls  = class (.a.hP$plot))
 			rownames (.tmp.df) <- devId
 		}
-		sink (file = stderr (), type = "output")
-		print (.tmp.df)
-		sink (file = stdout (), type = "output")
+		.tmp.df
 	}
+	getSavedPlotsSummary <- function ()
+	{
+		.tmp.df <- data.frame (
+			call = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "call"),
+			size.KB  = sapply (lapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "plot"), function (x) object.size(x)/1024),
+			pkg  = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "pkg"),
+			timestamp  = sapply (savedPlots[unlist (.sP.index, use.names = FALSE)], "[[", "time"))
+		rownames (.tmp.df) <- NULL
+		.tmp.df
+	}
 	
 	## Utility / call labels functions:
 	.get.sP.calls <- function ()
@@ -653,12 +646,12 @@
 	{
 		# this can be easily extended to more types
 		switch (savedPlots [[.sP.index [[n]]]]$pkg,
-			graphics = .get.oldplot.call.std2 (l, cs),
-			unknown = .get.oldplot.call.std (n, l),
+			graphics = .get.oldplot.call.std (l, cs),
+			unknown = .get.oldplot.call.unk (n, l),
 			lattice = .get.oldplot.call.lattice (n, l),
 			"Unknown")
 	}
-	.get.oldplot.call.std <- function (n,l=0)
+	.get.oldplot.call.unk <- function (n,l=0)
 	{
 		# rp <- recordPlot () is a nested pairlist object (of class "recordedplot"):
 		# rp[[1]] is the "meta data", rp[[2]] is always raw,
@@ -697,7 +690,7 @@
 		
 		paste (substr (.lab.str, 1, l), "...", sep = "")
 	}
-	.get.oldplot.call.std2 <- function (l=0, cs)
+	.get.oldplot.call.std <- function (l=0, cs)
 	{
 		.lab.str <- paste (ifelse (is.call (cs), deparse (cs), cs), collapse = ifelse (l<=0, "\n", ", "))
 		if (l <= 0 || nchar (.lab.str) <= l) return (.lab.str)


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