[R] lattice contourplot error

Deepayan Sarkar deepayan.sarkar at gmail.com
Tue May 22 00:14:06 CEST 2007


On 5/21/07, Mihai Bisca <mbisca at gmail.com> wrote:
> On 5/21/07, Deepayan Sarkar <deepayan.sarkar at gmail.com> wrote:
>
> > > I get the following error message: Error in validDetails.text(x) :
> > > Invalid 'rot' value
>
> > This depends on the data (and I haven't been able to reproduce it),
> > but I'm pretty sure the culprit is the calculation of the rotation for
> > the contour labels. You can probably work around it by changing
> > 'label.style' (see ?panel.contourplot). I can try to fix it if you
> > give me a reproducible example (e.g. save() your matrix and send it to
> > me offline).
>
> Thank you for your interest. I'm new to R, but pretty enthusiastic
> about it. You can find attached the matrix in question. It's a
> representation of an optic disc from a retinal photograph.
>
> I noticed that the error occurs only when using the option 'pretty=T'.
> Also, it happens in two of about seven or eight similar objects I
> played with.

Cool example. It's a problem with the label rotation calculation (some
are NaN, so presumably there's a division by zero somewhere). I'll try
to track it down.

For your example, I don't think labels are going to be of any use, so
I would suggest you try something like

contourplot(bd.cn, cuts = 20, labels = FALSE)

or

levelplot(bd.cn)

both of which should be fine.

-Deepayan



More information about the R-help mailing list