I have created a two-y-axis plot to display two groups of points using the plotrix
package, and the next step is to add regression lines for the two groups of points, respectively. But I have no idea how to handle this situation. Any suggestions? Thank you in advance!
Example code to create two-y-axis plot:
library(plotrix)
xval1 <- seq.Date(as.Date("2017-01-02"),
as.Date("2017-01-10"), by="day")
xval2 <- seq.Date(as.Date("2017-01-01"),
as.Date("2017-01-15"), by="day")
going_up <- seq(3,7,by=0.5)+rnorm(9)
going_down <- rev(60:74)+rnorm(15)
twoord.plot(2:10, going_up,1:15, going_down, xlab="Sequence", type = 'p',
ylab = "Ascending values",rylab="Descending values",lcol=4)