I have a problem in R and I need a little help.I want to fit linear progression line in a graph with 3 different plots that I have created and I cannot find the right code. For three separate linear progression lines, each one for each of my 3 plots, I have no problem...but for a total linear progression line for all my 3 plots I cannot find something useful. Any kind of help would be appreciated...here is my code:
plot(Age ,Depth, type="l", xlim= rev(c(min_x, max_x)), ylim= rev(c(min_y, max_y)),
col= "red", xaxt='n', yaxt='n', xaxs="i", yaxs="i", xlab=NA, ylab=NA)
lines(Age1, Depth1, col="dark green")
lines(Age2, Depth2, col="blue")
axis(side= 3)
axis(side= 4, las=2)
mtext(side=3, line=2.3 , "Age (Ma)")
par(mar = c(5, 4, 4, 8) + 0.2)
mtext(side=4, line=3 , "Depth (mcd)")
AgeAll = c(Age, Age1, Age2)
DepthAll = c(Depth, Depth1, Depth2)
abline(lm(DepthAll ~ AgeAll))