Dear all, 

let consider the following function:

Fun1 <- function() {
  library(lattice)
  plot1 <- 1:10~1:10
  pl1 <- xyplot(plot1)
  return(pl1$call$x)
}

In R 2.5.0 (or older version) we have

> Fun1()
plot1

but starting from R 2.5.1 until the latest R 2.8.0  we obtain instead
 
> Fun1()
NULL

because pl1$call seems to be equal to xyplot() without arguments. 

Something like xyplot(x=plot1) doesn?t work either. Again we have that  
pl1$call is equal to xyplot() without arguments

The situation is slightly different if we call the xyplot in the global 
environment:

> plot1 <- 1:10~1:10
> pl1 <- xyplot(plot1)
> pl2 <- xyplot(x=plot1)

then we have

> pl1$call
xyplot(plot1)
> pl1$call$x
NULL

but at least

> pl2$call
xyplot(x = plot1)
> pl2$call$x
plot1

Someone knows if in R 2.8.0 it is possible to retrieve the name of the x 
argument (i.e. plot1) directly from an object of class ?trellis? when the 
corresponding lattice function (e.g. xyplot) is inside another function 
(e.g. Fun1)?

Thanks in advance
Vincenzo

-----------------------------------------------------------------------------------
Vincenzo Luca Di Iorio
Consultant PME User support - GSK R&D Limited
-----------------------------------------------------------------------------------

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to