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

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


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

Log Message:
-----------
Describe the summary functions in the help file and add a combined wrapper function for these.

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

Modified: trunk/rkward/rkward/pages/rkward_plot_history.rkh
===================================================================
--- trunk/rkward/rkward/pages/rkward_plot_history.rkh	2010-09-17 07:13:27 UTC (rev 3044)
+++ trunk/rkward/rkward/pages/rkward_plot_history.rkh	2010-09-17 07:44:27 UTC (rev 3045)
@@ -16,7 +16,7 @@
 		<li><b>First, Previous, Next, and Last plot</b>: Obvious browsing (or replaying) actions. These will try to save any unsaved/pending plot before displaying/replaying the intended (first / previous / next / last) plot. This should be very helpful for browsing to an already stored in the history and update it. For example, a base graphics plot modified by, say, <code>abline(h=0, v=0)</code> will automatically get stored "in-place" in the history.</li>
 		<li><b>Append this plot</b>: This action is provided to forcefully append the displayed plot to the end of the history, irrespective of its status (saved / unsaved) and type (graphics / lattice / ...). In cases when a plot does not automatically get stored in the history, this action should come in handy. But this flexibility comes at the cost of not being able to identify the plot call.</li>
 		<li><b>Remove this plot</b>: This will remove the currently displayed from the history (if it is stored) and replay the next "available" plot. When multiple devices are displaying the same plot (to be precise, same position in the history), then removing a plot from one device will not remove it from other devices; instead it will set the status of this plot on the other devices as new / pending. Thus, if you happen to remove one by mistake, and if it happens to be displayed on a second device, then you can re-add it to the history from the second device.</li>
-		<li><b>Clear history</b>: As the name suggests, this action will clear the plotting history. But the plots currently displayed on the devices, upon further action, will get added back to the history. To completely reset the screen device history close all open devices and call <code>rk.record.plot$clearHistory()</code></li>
+		<li><b>Clear history</b>: As the name suggests, this action will clear the plotting history. But the plots currently displayed on the devices, upon further action, will get added back to the history. To completely reset the screen device history close all open devices and call <code>rk.clear.plot.history()</code></li>
 		<li><b>Plot properties</b>: This shows some additional information such as the size of the displayed plot as stored in the memory, the position of the current plot in the history, and, whenever possible the complete plot call.</li>
 	</ul>
 	</section>
@@ -34,6 +34,7 @@
 	<section title="Technical Details" id="scd_tech">
 	Some assorted technical details:
 	<ul>
+		<li><code>rk.plot.history.summary(which,type)</code>: this helper function provides some summaries about the screen device history. Here, <code>which</code> is a "device id" (default is <i>NULL</i>: summaries about all managed devices) and <code>type</code> is either <i>devices</i> (returns device specific information) or <i>history</i> (returns information on all the saved plots in the history).</li>
 		<li>Technically speaking, function calls that pass through either <code>graphics::plot.new()</code> or <code>graphics::persp()</code> or <code>lattice::print.trellis()</code> are captured.</li>
 		<li>The base graphics plots are recorded and replayed using <code>recordPlot()</code> and <code>replayPlot()</code>.</li>
 		<li>The lattice plots are added to the history using a custom <code>print.trellis()</code> function set by <code>lattice.options("print.function")</code>. So, you are warned against resetting or modifying this from a running RKWard session. Similarly, you are very strongly advised agiainst using the <code>plot</code> method on a trellis object since it will not pass through <code>print.trellis()</code> and hence not be stored in the history. This may seem innocuous, but it will have irreparable consequences when trying to use <code>trellis.last.object()</code>, thereafter. You have been warned!</li>

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-17 07:13:27 UTC (rev 3044)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public_graphics.R	2010-09-17 07:44:27 UTC (rev 3045)
@@ -574,7 +574,6 @@
 	}
 	
 	## Utility / print functions:
-## TODO: add these functions to rkh file
 	getDevSummary <- function (devId = NULL)
 	{
 		message ("History length   : ", sP.length)
@@ -814,3 +813,13 @@
 	if (!getOption ("rk.enable.graphics.history")) return (invisible ())
 	rk.record.plot$.verify.hist.limits (as.integer (lmax))
 }
+"rk.plot.history.summary" <- function (which = NULL, type = c ("devices", "history"))
+{
+	ret <- NULL
+	if (getOption ("rk.enable.graphics.history")) 
+		ret <- switch (
+			devices = rk.record.plot$getDevSummary (which),
+			history = rk.record.plot$getSavedPlotsSummary (),
+			NULL)
+	ret
+}


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