0 votes
1 view
in R Programming by (5.3k points)

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 the base function pairs.

1 Answer

0 votes
by (25.3k points)

To create a matrix of scatterplots, you can use the ggpairs() function from the GGally package as follows:

install.packages("GGally")

library(GGally)

data(iris)

ggpairs(iris[,1:3])

Output:

image

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...