Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Controlling the number of panels in a lattice plot with R

Tags:

plot

r

lattice

How do I limit the number of panels shown on a single page using lattice? I am graphing the results of a regression for multiple states and putting 50 of these on a single page makes them unreadable. I would like to limit the output to 4 wide and as many tall as needed.

Here's my lattice code:

xyplot(Predicted_value + Actual_value ~ x_value | State_CD, data=dd)

There are 50 different values for State_CD

like image 898
JD Long Avatar asked Aug 21 '09 16:08

JD Long


1 Answers

Have a look at the layout parameter.

Maybe you want something like:

xyplot(Predicted_value + Actual_value ~ x_value | State_CD, data=dd, layout = c(4,5))
like image 85
hadley Avatar answered Oct 19 '22 22:10

hadley