The problem is that you've instructed R to place lines at the values 91.55,
99.39, 97.04, 92.37 and 88.02, but these values do not correspond to the
user coordinates of the x-axis (which you've specified to be dates).
Luckily, the dates where you need lines are in the rownames of zi. You do
need to convert them to your user coordinates--and that depends on how plot
decides to specify your user coordinates, which hinges on the range of your
full data set (you clipped it).
What's on your x-axis? Do par("usr") when you have one of the
plots open and
tell me what R says.
Kevin
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Laura Holt
Sent: Tuesday, June 29, 2004 2:06 PM
To: r-help at stat.math.ethz.ch
Subject: [R] abline and its objects
Hi R People:
Is there a way to put an abline line for its objects on a plot, please?
I have an its object, ibm2, which runs from the January 2 through May 28.
>ibm2
ibm
2004-01-02 91.55
2004-01-05 93.05
2004-01-06 93.06
2004-01-07 92.78
2004-01-08 93.04
2004-01-09 91.21
2004-01-12 91.55
2004-01-13 89.70
2004-01-14 90.31
2004-01-15 94.02
.
.
.
I plot the data. No Problem.
Now I extract the first day of the month in this
fashion.>zi <-
extractIts(ibm2,weekday=T,find="first",period="month")
>zi
ibm
2004-01-02 91.55
2004-02-02 99.39
2004-03-01 97.04
2004-04-01 92.37
2004-05-03 88.02>
Still ok.
I would like to put a vertical line at each of the zi values.
>abline(v=zi,type="h",col=2)
>lines(zi,type="h",col=2)
>
Nothing happens.
I tried creating another its object with NA in all but the zi places. Then
I used lines(test1)
Still nothing happened.
Any suggestions would be much appreciated.
R Version 1.9.1
Sincerely,
Laura H
mailto: lauraholt_983 at hotmail.com
Married. http://lifeevents.msn.com/category.aspx?cid=married
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html