0

With xyplot from the lattice package, I can produce a scatterplot of y ~ x disaggregated into separate panels by factors (e.g., f1 and f2) with xyplot(y ~ x|f1*f2, data=d). I would like to change that so that the panels relate to values of f1 but within each panel there are separate lines y~x on each level of factor f2. I assume that it would be possible by changing the panel= option but I cannot see how to do it.

I think that this question has probably been asked before but in a different way ... resulting in me being unable to find anything!

CrimsonDark
  • 661
  • 9
  • 20
  • It would help if you provided a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input data. I'm guessing you want `xyplot(y ~ x|f1, groups=f2, data=d)` but it's somewhat unclear. – MrFlick Feb 28 '15 at 16:18
  • @MrFlick Your guess was spot-on; your answer is exactly what I was looking for. Thank you. If you enter it as the answer (instead of a comment) I'll mark it as correct. – CrimsonDark Mar 02 '15 at 10:27

0 Answers0