[R] log(0) error is not handled in xyplot, Windows
Patrick Giraudoux
patrick.giraudoux at univ-fcomte.fr
Sat May 1 15:30:59 CEST 2004
Hi,
We had some exchanges off the list with Deepayan Sarkar about a bug (?) we cannot fix (it seems it does not occur under Unix). It
likely needs the help of somebody on Windows.
The initial problem was that when running the following script (Windows XP, R 1.8.1 as well as R 1.9.0):
> lset(col.whitebg())
> xyplot(rdens ~ annee | habitat,
> groups = sp, type = 'b',
> scales = list(y = list(log = TRUE)))
I got a crash (just show the "hourglass" icon, stay on, GUI.exe no longer answer, and I must interrupt the process via
Windows...)
When the following is used:
> lset(col.whitebg())
> xyplot(rdens+1 ~ annee | habitat,
> groups = sp, type = 'b',
> scales = list(y = list(log = TRUE)))
It draws the plot OK.
The same (plot drawn OK) , when lset(col.whitebg()) is not used.
The conclusion was that in the lset(col.whitebg()) environment, log(0) was not properly handled (leading to an error message or
something else).
I can provide a data.frame off the list to anybody who wants a reproducible example and to look at what happens.
Patrick Giraudoux
----- Original Message -----
From: "Deepayan Sarkar" <deepayan at stat.wisc.edu>
To: "Patrick Giraudoux" <patrick.giraudoux at univ-fcomte.fr>
Sent: Saturday, May 01, 2004 2:56 PM
Subject: Re: Fw: log(0) error is not handled in xyplot
> On Saturday 01 May 2004 07:50, Patrick Giraudoux wrote:
> > > library(grid)
> > > x = 1:10 / 11
> > > y = rep(.5, 10)
> > > y[5] = NA
> > > grid.lines(x, y)
> >
> > Does not give a crash and makes this plot:
>
> In that case, you should probably report the original xyplot problem to
> r-help. Hopefully someone on Windows would be able to figure it out.
> Make sure to give a reproducible example.
>
> Deepayan
----- Original Message -----
From: "Patrick Giraudoux" <patrick.giraudoux at univ-fcomte.fr>
To: "Deepayan Sarkar" <deepayan at stat.wisc.edu>
Sent: Thursday, April 29, 2004 4:15 PM
Subject: Re: Fw: log(0) error is not handled in xyplot
> > Hmm, that's very odd. So what exactly were your symptoms ? Did R crash
> > or just hang ?
>
> R crashes actually (just show the "hourglass" icon, stay on, GUI.exe no longer answer, and I must interrupt the process via
> Windows...).
>
> > BTW, if you are not looking for code compatible with S-PLUS, you can
> > omit the panel.superpose call (which is the default anyway when groups
> > are present); e.g.
> >
> > xyplot(rdens ~ annee | habitat,
> > groups = sp, type = 'b',
> > scales = list(y = list(log = TRUE)))
>
> I have just tried and get the same result under lset(col.whitebg()): a crash...
>
> Don't worry too much about this. Things go well when I pass rdens+1 rather than rdens, so the bug (if any bug) can be turned...
>
> Best regards, and warm thanks for all the work you have done (and still do).
>
> Patrick
>
>
>
>
> ----- Original Message -----
> From: "Deepayan Sarkar" <deepayan at stat.wisc.edu>
> To: "Patrick Giraudoux" <patrick.giraudoux at univ-fcomte.fr>
> Sent: Thursday, April 29, 2004 3:35 PM
> Subject: Re: Fw: log(0) error is not handled in xyplot
>
>
> > On Thursday 29 April 2004 02:43, Patrick Giraudoux wrote:
> > > > Could you give me a reproducible example ?
> > >
> > > My pleasure. Actually I have refined the analysis after your e-mail.
> > > The trouble comes from the use of lset(col.whitebg()), scales,
> > > panel.superpose, in combination. This does not simplify the things...
> >
> > Hmm, that's very odd. So what exactly were your symptoms ? Did R crash
> > or just hang ?
> >
> > > Just load the attached file, a data.frame saved with
> > > save(tblcinetique,file="tblcinetique"), and run the following script:
> >
> > Well, I don't see a major problem with either on 1.9.0, and I don't have
> > a 1.8.1 handy right now (I'll try if I get the opportunity).
> >
> > There is a small problem with the first plot, which stems from a grid
> > bug. Effectively what happens is that although NA's are normally
> > removed before the data gets passed to the panel function, in this case
> > the log(0) = -Inf is not being removed. But I'll probably wait for this
> > to be fixed in grid.
> >
> > BTW, if you are not looking for code compatible with S-PLUS, you can
> > omit the panel.superpose call (which is the default anyway when groups
> > are present); e.g.
> >
> > xyplot(rdens ~ annee | habitat,
> > groups = sp, type = 'b',
> > scales = list(y = list(log = TRUE)))
> >
> > Deepayan
>
More information about the R-help
mailing list