Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...