I have two variables that I want to plot in R, one of them (B) is missing some data points. I want to draw a line between the existing points in B
I want to connect the blue points at 1, 5, and 10. If I replace NA with zeros, I get the same image since my Y range starts from 1. And I do not want to have the line going down to zero and making a point there.
This is the code I have so far:
A<-c(187.674646,101.734756,85.674646,57.327278,51.207435,49.438306,47.939082,44.17294,42.613277,39.916711)
B<-c(27.13350001, NA , NA , NA ,41.5181 , NA , NA , NA , NA ,79.18489934)
plot(A, type="o", pch=16, cex=1.5, lty=1, lwd=0.25, col="red", ylim=graph_range, log="y", axes=FALSE, ann=FALSE)
axis(1, at=1:10, lab=c("1","2","3","4","5","6","7","8","9","10"),cex.axis=0.95, las=1)
yticks <-c(10,100,1000,10000)
axis(2, at=yticks, lab=c("10","100","1000","10000"),cex.axis=0.95)
box()
lines(B, type="o", pch=16, cex=1.5, lty=1, lwd =0.25, col="blue")