When missing data is present or there is a large gap in the dates, ggplot produces a discontinuous line.
Eg:

q.data<-structure(list(date = structure(c(15544, 15546, 15547, 15548,
15550, 15552, 15554, 15556, 15575, 15580, 15587, 15588, 15589,
15593, 15596), class = "Date"), data = c(NA, 0.2, 0.2, 0.3, 0.6,
0.7, 0.8, 0.9, NA, NA, 1, 1, 1.1, 1.7, 2)), .Names = c("date",
"data"), row.names = c(NA, -15L), class = "data.frame")
q.data$date<-as.Date(q.data$date, format="%Y-%m-%d")
q.plot<-qplot(data=q.data,
x=date,
y=data)+geom_line()
print(q.plot)
I am looking for a way to force a continuous line.
I don’t think it really happens with a large gap in the dates, in the absence of
NAs. TheNAvalues seem to be your problem.I think
should work, but what I tried (which worked) was
PS: 1. it would be slightly nicer to use
dputto post your data. 2. My solution also gets rid ofNAvalues at the beginning and end of the series, which could conceivably be problematic …