[R] Consistent behaviour of for-loop

Petr PIKAL petr.pikal at precheza.cz
Thu Apr 15 13:22:25 CEST 2010


Hi

r-help-bounces at r-project.org napsal dne 15.04.2010 13:00:57:

> Peter Ehlers wrote:
> > You are mixing 'traditional' graphics (par(...)) and
> > 'lattice' graphics.
> > That won't work. In lattice, you use the 'layout' argument to
> > select the number of columns/rows. This is easiest if you set
> > up a conditioning variable:
> >
> >   cond <- gl(12, 20, labels = letters[1:12])
> >   x <- rnorm(12*20)
> >   qqmath(~x | cond, layout = c(4, 3))
> >
> > Note that layout = c(columns, rows), not c(rows, columns).
> >
> > Since you're new to R, let me also recommend very strongly
> > that you learn to use the str() function (not needed for
> > this problem, but undoubtedly indispensible in your further
> > adventures in R-land).
> > 
> Nice example, and good recommendation!
> 
> (It is difficult to satisfy me:)
> How can one know/see, what is traditional graphics, and what is lattice 

I would prefer to name it base and grid graphics. 

Base is in graphics and grDevices packages and grid graphics is in grid 
package. Only some packages use grid graphics (lattice, ggplot2, nlme for 
some) many more packages use base graphics. You can not simply mix 
functions from one with another, however if you dig deeper you can find 
that it is possible.

Basically if you do not intend to develop graphic package you probably 
will use what others developed for you and you will use base graphics most 
of the time.

Fro lattice help page

 Lattice is built upon the Grid graphics engine and requires the
     ‘grid’ add-on package.  It is not (readily) compatible with
     traditional R graphics tools. 

Regards
Petr


> graphics? Or is it try-and-fail-and-use-the-alternative?
> 
> Thanks,
> 
> Uwe
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list