Dear friends. I appreciate the help that plot.date is not yet fully
developed but beautiful and efficient as is anyway. I attach again an
example from a real patient and now the problem is how to represent a
chemical C-reactive protein (CRP) on the plot together with concentration
of vancomycin. CRP was 25-200 and vancomycin below about 20. I only could
get it about right by dividing CRP by 10 and the plot is informative as is
- but how could I make an axis for the CRP ? I've tried taking all axes
away (but dates are not taken away, anyway) and adding
axis(4,at=seq(25,200,by=25)) but it will leave the plot at the upper right.
So, will I have to construct it from mtext ?
I too would be happy to have also more basic R-oriented material akin to
Maindonald's
http://room.anu.edu.au/~johnm/
--also so not to have to make all these basic questions to the very
advanced people around.
Thanks for your efforts and dedication - and patience.
Yours
Troels
data <- read.table("vanco2.dat",h=T)
attach(data)
library(date)
dates <- mdy.date(month,day,year)
plot(dates,vanco,pch=c(19),xlab='',ylab="[Vancomycin] ",
main="Vanco versus ugentlig dosis")
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)
points(dates,CRP/10,pch=c(9))
-------------- next part --------------
month day year dosis vanco CRP
12 31 1999 1 3.8 192
1 3 2000 1 2.4 200
1 5 2000 NA NA 190
1 7 2000 1 3.4 NA
1 12 2000 2 7.1 NA
1 14 2000 2 5.3 NA
1 17 2000 2 5.7 123
1 19 2000 3 7.7 NA
1 21 2000 3 8.3 82
1 24 2000 4 8.7 83
1 26 2000 4 11.1 NA
1 31 2000 4 12.3 74
2 2 2000 NA NA 83
2 7 2000 4.5 12.0 71
2 14 2000 4.5 14.9 71
2 18 2000 4.5 23.0 NA
2 21 2000 NA NA 93
2 25 2000 3 20.1 67
2 28 2000 2 11.3 78
3 1 2000 2 13.7 NA
3 3 2000 NA NA 64
3 6 2000 NA NA 47
3 8 2000 3 12.8 NA
3 10 2000 3 7.4 NA
3 13 2000 3 9.1 33
3 15 2000 3 12.2 NA
3 17 2000 3 13.8 33
3 20 2000 NA NA 36
3 27 2000 NA NA 32
4 3 2000 NA NA 36
4 5 2000 NA NA 37
4 10 2000 NA NA 25
4 17 2000 NA NA 24
4 24 2000 NA NA 24
4 26 2000 NA NA 25
-------------- next part --------------
Troels
look here:
http://www.wired.com/wired/archive/8.04/joy.html