[R-SIG-Finance] plotting vertical lines on months in xyplot

Worik worik.stanton at gmail.com
Wed Mar 16 03:47:11 CET 2011


I have a similar problem as Jeff had back in the day.  I want to put a 
vertical line on a plot

There must be a way....

Simple example:

library(xts)
v <- vector()
v[1] <- 10
for(i in 2:100){
   v[i] <- v[i-1]+rnorm(1, 0, 0.01)
}
X <- xts(v, seq(as.Date("2009-01-01"), by=1, length.out=100))
plot(X)

## Try to put a vertical line in....
abline(v=X[50,])
abline(v=50)
abline(v=index(X)[50])



-- 
If we amplify everything, we hear nothing.
--



More information about the R-SIG-Finance mailing list