Is this what you mean? x=c(1,2,2,3,4,5,6,3,2,1) y=c(2,3,4,2,1,2,3,4,5,6) matplot(cbind(x,y),type="l") which(diff(sign(x-y))!=0)+1 [1] 4 8
-- View this message in context: http://r.789695.n4.nabble.com/Finding-points-where-two-timeseries-cross-over-tp2313257p2313510.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.