[R] Can I save R graphs as a R objects

Greg Snow Greg.Snow at imail.org
Fri Jan 15 22:20:38 CET 2010


As a general rule, you really do not want to edit graphs by pointing/clicking/dragging.  It may seem an easy way to make some modifications, but in the long run it will become more of a headache than a help.  Better to create a script with the commands to create the plot, then if there is some change you want made, find the correct change or addition to the script and rerun the script.  That way when later on you have a similar project and want to create the same or similar graph, you can just run the script again with the new data, making any minor changes that you need.

On the other hand if you create the basic plot then edit it using point/click/drag style tools, then a couple months later when you find that there was a typo in the data and you need to recreate the graph (not as rare an event as we would like), you will first need to remember how you created the graph, then you will need to remember all the point/click/drag steps that you took (and redo them).  It is just simpler to use the script.

Having said that, if you still feel the need to modify a plot using a mouse (don't complain when you have to redo all the steps to redo the graph) then some options include:

Save the graph as an svg file (Cairo device, or other package) then use inkscape or other program to edit it.
Save the graph as a fig file and use xfig/winfig/jfig to edit it.
Save/copy the graph as a windows meta file and use Excel/Word to edit it.

But the R paradigm is really to use a script to create the correct graph in the first place rather than give an incorrect graph and expect the user to use non-reproducible post-hoc modifications.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of vikrant
> Sent: Friday, January 15, 2010 2:27 AM
> To: r-help at r-project.org
> Subject: [R] Can I save R graphs as a R objects
> 
> 
> Can I save R graphs as a R objects ? IF yes then if I click this R
> object
> can I edit my chart as in Excel.
> Please suggest your views
> --
> View this message in context: http://n4.nabble.com/Can-I-save-R-graphs-
> as-a-R-objects-tp1014621p1014621.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list