Re: [R] if/else for plot/lines?

From: hadley wickham <h.wickham_at_gmail.com>
Date: Fri, 7 Dec 2007 10:15:03 -0600

On Dec 7, 2007 4:28 AM, Roger Levy <rlevy_at_ucsd.edu> wrote:
> I'm interested in writing a function that constructs a new plot on the
> current graphics device if no plot exists there yet, but adds lines to
> the existing plot if a plot is already there. How can I do this? It
> seems to me that the exists() function might be co-opted to do this, but
> it's not obvious how.

You might want to look at the ggplot2 package, http://had.co.nz/ggplot2/, which exposes plots as objects that can be easily manipulated.

Hadley

-- 
http://had.co.nz/

______________________________________________
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.
Received on Fri 07 Dec 2007 - 16:20:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 07 Dec 2007 - 16:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.