Hi > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Christof Kluß > Sent: Friday, October 26, 2012 1:42 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] connect points in charts > > Hi > > is there a automatic way that long distances between points are not > connected. I have something like > > plot(x,y,type="o",...) > > atx <- seq(as.Date("2009-04-01"),as.Date("2011-04-01"),"month") > > axis.Date(1, at=atx,labels=format(atx, "%b\n%Y"), padj=0.5 ) > > but I do not want lines between points whose distance is greater than > two weeks.
You can discard a line by entering NA between dates. plot(1:10, 1:10, type="o") plot(c(1:5,NA,7:10), 1:10, type="o") So you shall construct new data in which you put NA on propper places. Regards Petr > > thx > Christof > > ______________________________________________ > 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. ______________________________________________ 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.