Nov 14, 2019 in R Language

Q: ggpairs in R Language

1 Answer

Nov 14, 2019

Finally, we introduce another function from the GGaly library. Ggpair. It produces a graph in a matrix format. We can display three kinds of computation within one graph. The matrix is a dimension, with equals the number of observations. The upper/lower part displays windows and in the diagonal. We can control what information we want to show in each part of the matrix. The formula for ggpair is:

ggpair(df, columns = 1: ncol(df), title = NULL,
    upper = list(continuous = "cor"),
    lower = list(continuous = "smooth"),
    mapping = NULL)		


  • df: Dataset used
  • columns: Select the columns to draw the plot
  • title: Include a title
  • upper: Control the boxes above the diagonal of the plot. Need to supply the type of computations or graph to return. If continuous = "cor", we ask R to compute the correlation. Note that, the argument needs to be a list. Other arguments can be used, see the [vignette]("") for more information.
  • Lower: Control the boxes below the diagonal.
  • Mapping: Indicates the aesthetic of the graph. For instance, we can compute the graph for different groups.
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Nov 14, 2019 in R Language
Nov 14, 2019 in R Language
Nov 14, 2019 in R Language