[Rd] savePlot() no longer automatically adds an extension to the filename.

S Ellison S.Ellison at lgc.co.uk
Wed Jun 4 13:44:05 CEST 2008


>>> Michael Prager <Mike.Prager at noaa.gov> 06/04/08 4:28 AM >>>
>There is much to be said for consistency (across platforms and 
>functions) and stability (across versions) in software.

I could not agree more. But while consistency  is an excellent reason
for making the patch consistent across platforms, it doesn't help decide
what the consistent behaviour should be. It is as strong an argument for
retaining the original behaviour at 2.6.x as for keeping a change. 

As to filename extensions or their lack; in practice, RGui.exe addds a
defult Rdata extension on saving a workspace via the GUI, and so does
saving history, so we already have overwriteable default extensions for
those purposes even though the command line behaviour doesn't do that. 
And it genuinely does help, which is my main motivation here.

The main advantage of the present patch is that it delivers _most_ of
the optional behaviours missing from both 2.6.2 and 2.7.0 without adding
an extra parameter. But it isn't the best that could be done. If there
is a platform-independent way of keeping the default extension-by-type
and allowing the option of removing it entirely (in other words, an
extra parameter to savePlot) I'd personally see that as a better way
forward than the present patch. 
An alternative might be to keep the 2.7.0 savePlot and define a new
convenience function (SavePlot, say, or save.plot for extra dottiness) 
which provides the wrapper. It would have impact on legacy code, but it
is a lot easier to change a function name throughout legacy code than to
change supplied parameters.

In the mean time, consistency arguments would indicate that the present
patch should be applied to all platforms if at all.

Steve E

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-devel mailing list