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.
vikrant wrote:> 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 >When you use the graphics functions from the lattice package (e.g. xyplot) you can save them to a file (see ?save) because it creates an object that represents the graph. When using the standard plot system I think this is not possible. But if you have the original data and an R script to make the graph, you don't need to save the graph explicitly. When processing the data for the graph takes a long time, you can run the script to just before making the graph and save all the appropriate objects to disk. Next time you only need to load your data (see ?load) and make the plot. cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul
You can use the recordPlot function from base package also On Fri, Jan 15, 2010 at 7:26 AM, vikrant <vikrant.shimpi at tcs.com> wrote:> > 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
On Fri, Jan 15, 2010 at 11:26 AM, vikrant <vikrant.shimpi@tcs.com> wrote:> > Can I save R graphs as a R objects ?I have seen that feature in the rkward GUI (which is by the way the BEST GUI I have seen for a long time!), but I haven't played with that feature a lot, so I can not comment on your second question. By the way: rkward has SOME editing functionality for graphs, after they are created (GUI type) Cheers, Rainer 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@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. >-- NEW GERMAN FAX NUMBER!!! Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Cell: +27 - (0)83 9479 042 Fax: +27 - (0)86 516 2782 Fax: +49 - (0)321 2125 2244 email: Rainer@krugs.de Skype: RMkrug Google: R.M.Krug@gmail.com [[alternative HTML version deleted]]
On 1/15/10, vikrant <vikrant.shimpi at tcs.com> wrote:> can I edit my chart as in Excel. >Sort of, using playwith. You can always try to place the the plot call inside playwith(). For example, require(playwith) playwith(plot(1:10)) Liviu
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.