Re: [R] problem with xyplot

From: David Winsemius <>
Date: Sun, 20 Mar 2011 18:06:30 -0400

On Mar 20, 2011, at 4:06 PM, askh wrote:

> Hi all,
> I am having a problem using xyplot from lattice library. I am
> plotting one
> variable against another one, conditioning on two other variablesm
> one of
> which has 3 levels and the other 6 levels. The output is thus a 6x3
> panel
> plot. Here's my code:
> print((xyplot(CloDurPercent[CloDurNA != 'NA' &
> Mscor<3.5]~ConsDur[CloDurNA
> != 'NA' & Mscor<3.5]|Pos*ConsId, data = Stops, pch = '.'))
> One of the panels is not plotting the data in it -- it remains
> blank. I
> first thought that I had some problem with this particular data
> subset but
> no, when I reordered levels and plotted the data again, a different
> subset
> is not showing up in the same panel as before. This is the outcome
> whether I
> print on the Quartz device or save the plot to a .ps file. What's
> going on?
> Is there some hardware/software interaction problem? I am using R 1.14

Really? If that is true then you are way, way behind the times. You may be offered a prize for the most ancient version in use. (Even if you were using the Mac-GUI version it would still be 5 years out of date.

> on
> MacOS X 10.3.9.

Well, maybe you are.


Hardware issues are still very unlikely.

The construction CloDurNA != 'NA' will not do what you think it does. Try:

! #instead

You could take a variable that should exist for every category and do something lik:

require(Hmisc) # or some other package with a describe function with(CloDurPercent, tapply(CloDurPercent[!is,na(CloDurNA) & Mscor<3.5], c(ConsId, Pos, CloDurPercent[!is,na(CloDurNA) & Mscor<3.5]), describe)

Should give you a count of NA's and if all are missing in a particular category you will get all TRUE in one cell.

It might be prudent to upgrade if that was not a typo and provide more information about your dataset


> Thanks,
> alina
> --
> View this message in context:
> Sent from the R help mailing list archive at
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD Heritage Laboratories West Hartford, CT ______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Sun 20 Mar 2011 - 22:52:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Mar 2011 - 00:00:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive