Is it possible to plot a matrix of scatter plots with ggplot2, using ggplot's nice features like mapping additional factors to color, shape etc. and adding smoother?
I am thinking about something similar to pairs().
Is it possible to plot a matrix of scatter plots with ggplot2, using ggplot's nice features like mapping additional factors to color, shape etc. and adding smoother?
I am thinking about something similar to pairs().
Yup it is. Just take a look at facets / faceting. This should do the job if I understood you correctly.
use something like:
yourplotobject +facet_grid(variable~variable)
here's a similar thread with some examples, plus you might also want to try plotmatrix:
library(ggplot2)
data(mtcars)
plotmatrix(mtcars[,1:3])
to me mpg (first column in mtcars) should not be a factor. I haven't checked it, but there's no reason why it should be one. However I get a scatter plot :)
HTH