[R] Unexpected Gap in simple line plot
D Kelly O'Day
koday at processtrends.com
Fri Jan 21 02:12:28 CET 2011
I am getting an unexpected gap in a simple plot of monthly data series.
I have created a csv file of monthly climate observations that I store
on-line. When I download the csv file and plot one of the series, I get a
gap even though there is data for the missing point.
Here is a snippet to show the problem.
## Strange plot results
link <- "http://processtrends.com/files/RClimate_CTS_latest.csv"
cts <- read.csv(link, header=T)
## Simple line plot - gap for no reason
plot(cts$yr_frac, cts$GISS, type="l", xlim=c(1982, 1983),xaxs="i",
yaxs="i")
## May, 1982 observation missing
## Add points to plot in red, to see if May shows up
points(cts$yr_frac, cts$GISS, type="p", col="red")
## yes, May shows up in points
## Look at cts data.frame. No obvious problems to me??
small <- subset(cts, cts$yr_frac >1982 & cts$yr_frac <1983)
small[,c(1,3)]
The same problem occurs in the other data vectors (HAD, NOAA, RSS, UAH, etc)
I have not been able to figure why I am getting the gap and how to show a
continuous line through May, 1982 data points.
Any suggestions?
D Kelly O'Day
http://chartsgraphs.worpress.com http://chartsgraphs.wordprss.com
--
View this message in context: http://r.789695.n4.nabble.com/Unexpected-Gap-in-simple-line-plot-tp3228853p3228853.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list