[R] xyplot: filtering out empty plots

Coen van Hasselt coenvanhasselt at gmail.com
Tue Jul 6 11:47:28 CEST 2010


Hello,

I would like to know how I can filter out empty plots in xyplot, when
stratifying on some variables.

Example:

I have a dataset in which I plot CONC ~ TIME, stratified for patient
ID(1,2,..,100), FORM(1,2) and BOOST (1,2).
Some patients (ID's) do not have values for all stratification
conditions. I.e. one patient may have values for FORM=1 and BOOST=1,2,
while others may have data on alle combinations.

xyplot(CONC ~ TIME | ID + FORM + BOOST, dat=data)

If I do this I also get empty plots for all the combinations for which
I do not have data for. Is it possible for xyplot NOT to make plots
for combinations of ID, FORM and BOOST that do not contain data ?

Thanks in advance!

Coen



More information about the R-help mailing list