[R] NLME: Limitations of using identify to interact with scatterplots?

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Fri Aug 18 05:04:35 CEST 2006


Many useful diagnostic plots can be recreated in the usual plot()
framework, with only a little coding effort. In this case, I would
imagine that

plot(dframe$log2game, fitted(D2C29.nlme))
abline(0,1)

should get pretty close, if the name of the dataframe containing the
variable is 'dframe'.

Andrew

On Thu, Aug 17, 2006 at 08:55:41AM -0500, Douglas Bates wrote:
> Most plotting functions in the nlme package use lattice graphics
> functions based on the grid package.  Identify will not work with
> lattice graphics.  I'm not sure if there is a replacement.
> 
> On 8/17/06, Greg Distiller <gregd at stats.uct.ac.za> wrote:
> > I have a quick question regarding the use of identify to interact with
> > points on a scatterplot. My question is essentially: can identify be used
> > when one is plotting model objects to generate diagnostic plots?
> > Specifically I am using NLME.
> > For example, I am plotting the fitted values on the x axis vs a variable
> > called log2game with the following code:
> >
> > plot(D2C29.nlme, log2game ~ fitted(.), abline=c(0,1))
> >
> > and then I have tried to use identify as follows:
> >
> > identify(D2C29.nlme$fitted[,2],Data2$log2game,row.names(Data2))
> >
> > (if I leave out the [,2] on the fitted attributes then I am told that x and
> > y are not the same length and it appears that this is due to the fact that
> > the fitted attribute has 2 columns.)
> >
> > but I get an error message that "plot.new has not been called yet".
> >
> > I am not sure if this is because I am doing something wrong or if identify
> > simply cannot be used in this context.
> >
> > Many thanks
> >
> > Greg
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
Email: a.robinson at ms.unimelb.edu.au         http://www.ms.unimelb.edu.au



More information about the R-help mailing list