[R] lattice graphics and source()

Marc Schwartz marc_schwartz at comcast.net
Wed Feb 14 01:55:41 CET 2007


On Tue, 2007-02-13 at 16:44 -0800, Dongfeng LI wrote:
> Hi,
> 
>    I am trying the lattice graphics in R. Let's say, such a little
> experiment in file myprog.r:
> 
> f <- function(){
>   x <- 1:10
>   y <- x^2
>   xyplot(y ~ x)
> }
> f()
> 
> Then I run the program:
> > source("myprog.r")
> 
> but nothing happens. Manully run f() at the command line:
> 
> > f()
> 
> then the figure is shown. This seems to be a bug only associated with
> lattice graphics, the old style plots do not exibit these behavior.


See the following FAQ:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f

HTH,

Marc Schwartz



More information about the R-help mailing list