From ripley at stats.ox.ac.uk  Thu May 29 09:32:28 2008
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 29 May 2008 08:32:28 +0100 (BST)
Subject: [Rd] quartz identify bug (PR#11491)
In-Reply-To: <alpine.LFD.1.10.0805290816590.16640@auk.stats.ox.ac.uk>
References: <20080520133006.D3564283416A@mail.pubhealth.ku.dk>
	<FDDE2CB4-976B-4CB0-8F2D-552093809956@r-project.org>
	<17489140.post@talk.nabble.com> <17522757.post@talk.nabble.com>
	<alpine.LFD.1.10.0805290816590.16640@auk.stats.ox.ac.uk>
Message-ID: <alpine.LFD.1.10.0805290830570.16640@auk.stats.ox.ac.uk>

On Thu, 29 May 2008, Prof Brian Ripley wrote:

> On Wed, 28 May 2008, someone ashamed of his real identity wrote:
>
> [...]
>
>> There is always the same problem with theses examples :
>> 
>> #1
>> x=rnorm(10)
>> qqnorm(x)
>> identify(x)
>> 
>> #2
>> x=rnorm(10)
>> par(mfrow=c(2,1))
>> plot(x)
>> qqnorm(x)
>> identify(x)
>> 
>> identify does not find any points.
>
> Correct, but it is user error.  From the help for identify:
>
>     x,y: coordinates of points in a scatter plot.  Alternatively, any
>          object which defines coordinates (a plotting structure, time
>          series etc: see 'xy.coords') can be given as 'x', and 'y'
>          left missing.
>
> and qqnorm does not do a scatter plot of 'x'.  You need something like (look 
> at qqnorm.default)
>
> xx <- qnorm(ppoints(length(x)))[order(order(x))]
> identify(xx, x)
>
> (If there were missing values you would need to work harder.)

Or just

xx <- qqnorm(x)
identify(xx)

at least for the default method.

-- 
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



[Rd] quartz identify bug (PR#11491)
Prof Brian Ripley