[R] xaxp with dates

Troels Ring tring at mail1.stofanet.dk
Wed Apr 26 22:37:58 CEST 2000


Dear friends.
As promised ver 1.01 solved the former problem and now dates plot OK in 
windows. But.
In the following code, "cex.axis"=0.5 works OK but "xaxp"=c(14620,14680,4) 
has seemingly no effect. The limits for xaxp was found from the default 
plot and inspecting par(). I need to put the date marks at specific points. 
Could I suppress them altogether and make a new xaxis corresponding to the 
points ? Was xaxp not intended in this way ?
Thank you for your (so far) endless patience !

data <- read.table("vanco1.dat",h=T)
op <- par("xaxp"=c(14620,14680,4),"cex.axis"=0.5)
attach(data)
library(date)
dates <- mdy.date(month,day,year)
plot(dates,vanco,pch=c(19),xlab='',ylab="[Vancomycin]",
main="Vanco versus weekly dose")
abline(h=10,lty=2)
dm <- c(1,1,1,1,2,2,3)
dd <- c(7,17,21,31,23,25,3)
dy <- rep(2000,7)
limits <- mdy.date(dm,dd,dy)
abline(v=limits,lty=8)
x <- c(14611.37, 14620.95, 14627.94, 14634.44, 14650.85, 14663.85, 
14667.58,14680.15)
mtext(c("1","2","3","4","4.5","3","2","3"),3,at=x)
par(op)
-------------- next part --------------
month   day     year  dosis  vanco
12      31      1999    1       3.8
1       3       2000    1       2.4
1       7       2000    1       3.4
1       12      2000    2       7.1
1       14      2000    2       5.3
1       17      2000    2       5.7
1       19      2000    3       7.7
1       21      2000    3       8.3
1       24      2000    4       8.7
1       26      2000    4       11.1
1       31      2000    4       12.3
2       7       2000    4.5     12.0
2       14      2000    4.5     14.9
2       18      2000    4.5     23.0
2       25      2000    3       20.1
2       28      2000    2       11.3
3	1	2000	2	13.7
3	8	2000	3	12.8
3	10	2000	3	7.4
3	13	2000	3	9.1
3	15	2000	3	12.2
3	17	2000	3	13.8
-------------- next part --------------
Troels Ring, MD
Department of Nephrology
Aalborg Hospital, Denmark
tring at mail1.stofanet.dk 


More information about the R-help mailing list