[R] xyplot: discrete points + continuous curve per panel

RMan54 RMan54 at cox.net
Thu Dec 14 08:22:41 CET 2006


I have a number of x, y observations (Time, Conc) for a number of Subjects
(with subject number Subj) and Doses. I can plot the individual points with
xyplot fine:

xyplot(Conc ~ Time | Subj,
         Groups=Dose,
         data=myData,
         panel =  function(x,y) { 
              panel.xyplot(x, y) 
              panel.superpose(???) # Needs more here 
         } 
) 

I also like to plot on each panel (there is one Subj per panel) a continuous
curve with predictions that I can calculate from a rather complicated
function:

myPred <- (time, subj, dose) {
       returns predicted value of Conc for a given time, subj and dose
}

The predicted curves are different for each panel.

How do I plot the predictions? I have tried to add panel.superinpose in the
xyplot portion but can't link to the myPred function. I also know about
panel.curve but couldn't make it work.

My attempt is to calculate the predictions on the fly. Is this possible? Or
do I need to calculate all predictions first and put the results in a data
frame.
Thanks for any help,
Rene
-- 
View this message in context: http://www.nabble.com/xyplot%3A-discrete-points-%2B-continuous-curve-per-panel-tf2818931.html#a7867892
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list