2

I have a data frame like this:

x   y   z   value_a value_b value_c value_d value_e
1   2   3   0.268532492 0.262669608 0.751719909 0.232075193 0.939722699
1   2   4   0.538304308 0.82745881  0.971311789 0.579303734 0.607234604
1   2   5   0.305263269 0.365188497 0.948542272 0.818281045 0.097589211
1   4   6   0.918098132 0.33816255  0.145038653 0.715138165 0.872196223
1   4   2   0.081900699 0.737615199 0.74662762  0.125931795 0.75843879
5   6   7   0.949414205 0.660430123 0.900522376 0.376762285 0.899966217
5   6   8   0.107844469 0.792278152 0.453471175 0.458472709 0.379286901

I want to visualize how the values vary with respect to each other, using scatter plots. Specifically, I want 25 scatter plots, arranged in a 5x5 grid. Plot (1,1) should be value_a vs. value_a (a straight line), plot (1,2) should be value_a vs. value_b, plot (3,1) value_c vs. value_a and so on.

How can I make this plot?

Superbest
  • 25,318
  • 14
  • 62
  • 134
  • Please provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) when you're asking a question. Also sharing what you have tried so far would be a great help, as well as the expected output. – Adam Quek Apr 18 '17 at 01:22
  • 2
    You might want to check out [packages](https://cran.r-project.org/web/packages/GGally/index.html) that makes it easy to plot pairwise combinations of variables – caw5cv Apr 18 '17 at 01:29
  • As @Cory said, you're looking for `ggscatmat()` in `GGally`. – Brian Apr 22 '17 at 00:13

0 Answers0