Wolfram Fischer - Z/I/M
2002-Apr-17 07:38 UTC
[R] No output from (lattice) xyplot called within loops
Hello>From the following script I receiveda grafic output when I called: - xyplot.test( 'green3' ) - call.xyplot.test( 'blue3' ) I did NOT receive a grafic output when I called: - loop.xyplot.test( 'red3' ) What's the Problem? NB: I am using R 1.4.1 on Linux. --------- START OF SCRIPT ---------------- n <- 1000 x <- seq( 1, n ) y <- rnorm( n ) xyplot.test <- function( col ){ xyplot( y ~ x , col=col ) } call.xyplot.test <- function( col ){ xyplot.test( col ) } loop.xyplot.test <- function( c.col ){ for( col in c.col ){ xyplot.test( col ) } } --------- END OF SCRIPT ---------------- Wolfram Fischer -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
2002-Apr-17 07:53 UTC
[R] No output from (lattice) xyplot called within loops
You have to *print* the output from lattice. Auto-printing did this for you in the first two cases but not the third. On Wed, 17 Apr 2002, Wolfram Fischer - Z/I/M wrote:> Hello > > >From the following script I received > a grafic output when I called: > > - xyplot.test( 'green3' ) > - call.xyplot.test( 'blue3' ) > > I did NOT receive a grafic output > when I called: > > - loop.xyplot.test( 'red3' ) > > What's the Problem? > > NB: I am using R 1.4.1 on Linux. > > --------- START OF SCRIPT ---------------- > n <- 1000 > x <- seq( 1, n ) > y <- rnorm( n ) > > xyplot.test <- function( col ){ > xyplot( y ~ x , col=col )^print( ^)> } > > call.xyplot.test <- function( col ){ > xyplot.test( col ) > } > > loop.xyplot.test <- function( c.col ){ > for( col in c.col ){ > xyplot.test( col ) > } > } > > --------- END OF SCRIPT ------------------ 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._