[R] abline and its objects

Laura Holt lauraholt_983 at hotmail.com
Tue Jun 29 23:06:09 CEST 2004


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




More information about the R-help mailing list