I'm plotting a zoo object with daily rainfall data and some water-temperature measurements every 4 days. While merging the data I get some NA data in the days between and therefore the line does not connect the dots. Here a (very) minimal example with horrible layout:
install.packages('zoo')
library(zoo)
Datum<-as.Date(c("2017-07-01", "2017-07-02", "2017-07-03", "2017-07-04"))
data<-as.data.frame(Datum)
data$Rain<-c(3,5,6,7)
data$Temperature<-c(10, NA, 11, 12)
data.zoo<-read.zoo(data, by=Datum)
plot(data.zoo, type=c("h", "o"), lwd=c(5,1), col=c("blue", "red"))
What I need is a line between the temperature data points. I almost found the answer here Plotting xts objects works with points but not with lines. However, interpolating etc data is not possible (or meaningful) and I know that connecting punctual data is scientifically incorrect but if I do not, the plots are really not intuitiv and a optical comparison between the 25 plots very difficult. This is why I'd like to have the lines between the dots.
Not merging the data and hence not producing the NA is not really possible as otherwise the code block is not working anymore. The code block is kind of complicated (for my coding level) as e.g. the rainfall data and temperature data is on the same screen, fancy axis labelings, and contains a for loop to print out a pdf per group automatically etc.
Thanks a lot in advance, Tina