[R] interrupted plots

Kaspar Pflugshaupt pflugshaupt at cirsium.ethz.ch
Tue Feb 20 16:40:29 CET 2001

On Tuesday 20 February 2001 15:05, mlennert at club.worldonline.be wrote:

> Hello,
> I'm trying to plot simple data containing numbers/year.
> I use plot(numbers~year, type="l"), but the problem is that there is no
> data for several years. S I would like the line to be interrupted for the
> period without data, and then continue afterwards. How can I do this ?

I think this is easy: put NA entries into the data vector for those years

> Also, I've been using par(new=TRUE) to put two curves (same years,
> different numbers) on the same plot. Is there a way to do this differently,
> i.e. easier, for example directly in the plot command ?

You could use the matplot() command (see help(matplot))




Kaspar Pflugshaupt
Geobotanical Institute
ETH Zurich, Switzerland

mailto:pflugshaupt at geobot.umnw.ethz.ch
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list