[rkward-devel] Request for feedback on plot history
Prasenjit Kapat
kapatp at gmail.com
Tue Sep 7 20:51:33 UTC 2010
Hi,
On Tue, Sep 7, 2010 at 3:17 AM, Thomas Friedrichsmeier
<thomas.friedrichsmeier at ruhr-uni-bochum.de> wrote:
> 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.
Yeah, history () will not work. Period.
> 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.
Hmm.. a better idea than history, certainly.
Regards,
--
Prasenjit
More information about the Rkward-devel
mailing list