[rkward-devel] Request for feedback on plot history

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Sep 7 07:17:10 UTC 2010


Hi,

On Monday 06 September 2010, Prasenjit Kapat wrote:
> Can we get the last command from history?

in theory, yes, but not currently. (We do not support the R history 
mechanisms, yet, but it's in the feature tracker somewhere).

> Remember we are only interested in the primary plotting functions.
> Unfortunately, utils::history () calls file.show () in the end, so I
> don't think the paged output can be assigned to any variable. I was
> thinking of writing another history function (almost the same as
> utils::history) which would search for plot ()-type patterns, eg:
> "^(plot|hist|boxplot|...)". This function would be called from our
> wrapped plot.new () just before record () call. A properly crafted
> regex pattern, can hunt down the first line of a multiline command as
> well.

Note that the plot-call may not be in the history at all. The user may well 
have used a hand-written function (or one form some obscure package) that 
created the plot. And in fact a single top-level command may produce several 
totally different plots.

An alternative could be to inspect sys.calls() inside plot.new(). Although it 
may not always be clear, just which call best describes the plot. Also of 
course, there's the problem that not all plots are created with plot.new(), 
again. Still I would think this will probably be a more reliable method.

> Again, this is just an idea. What do yo think? Will it work?

Well, I'm not opposed against experimenting with this. But also, personally, 
I'm pretty happy with the current title-extraction, so I'd give this very low 
priority. Definitely not something to worry about before everything else 
working.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20100907/fefc004b/attachment.sig>


More information about the Rkward-devel mailing list