[R] Plotting Question

Coate, Bruce bruce.coate at pfizer.com
Thu Jan 16 17:10:06 CET 2003

For a clinical trial I am involved with, I would like a plot (for each
subject) similar to the following which will indicate what drugs that
subject was taking on each day during the study:

Drug 1    [---]           [----------------------]

Drug 2    [-------------------------------------]

Drug 3           [---------]  [----------------------------]
             0                                                n

                           Study Day

 I have thought about using strip plot, perhaps setting a flag each day the
subject is on study (1 if drug x is taken on that day, NA otherwise). But
that means I would have to create extra records for each subject because my
data looks something like,

Subject   Drug   Start          Stop
 1           1         5Jan2002   10Jan2002
 1           1        12Jan2002  30Jan2002
 2           2        15Feb2002  20Mar2002

Does anyone have a suggestion as to which kind of plotting function is best
suited to this? 

More information about the R-help mailing list