Skip to content
Back to formatted view

Raw Message

Message-ID: <f8e6ff050712070815n3f1c35car3688ff9ee7393652@mail.gmail.com>
Date: 2007-12-07T16:15:03Z
From: Hadley Wickham
Subject: if/else for plot/lines?
In-Reply-To: <4759205C.4060905@ucsd.edu>

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/