Re: [Rd] Strange behavior of pretty

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sun, 4 Nov 2007 08:02:49 +0000 (GMT)

On Sat, 3 Nov 2007, Duncan Murdoch wrote:

> On 03/11/2007 4:34 PM, Ulrike Grömping wrote:
>> Dear all,
>>
>> I got stuck with a weird behavior of pretty:
>> pretty(c(-1,1),n=1)
>> yields -2, 0, 2 instead of the desired result -1 1.
>> Likewise,
>> pretty(c(-2,2),n=1)
>> yields -5, 0, 5 instead of the desired result -2 2.
>
> I don't think pretty() should ever return -1 1 or -2 2. It should
> always return multiples of some round number, so it would have to
> include 0. But I don't see why it is expanding the range. It doesn't
> do that when the results are non-negative, e.g.
>
> > pretty(0:1, n=1)
> [1] 0 1
> > pretty(0:2, n=1)
> [1] 0 2
>
>> With n=0, the result is the same, while with n=2 everything is as
>> documented.
>>
>> This behavior nastily messed up some of my cube plots. Is there any chance
>> that this can be fixed?
>
> The documentation has been sitting for 8 years with "FIXME" notes in it,
> so I wouldn't hold my breath.

The way to make the 'chance' appreciable would be to contribute a (high-quality) patch.

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-devel_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Received on Sun 04 Nov 2007 - 08:05:52 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 Mon 05 Nov 2007 - 14:00:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.