ggally

How to add an external legend to ggpairs()?

风流意气都作罢 提交于 2019-11-27 02:18:36
问题 I am plotting a scatterplot matrix using ggpairs . I am using the following code: # Load required packages require(GGally) # Load datasets data(state) df <- data.frame(state.x77, State = state.name, Abbrev = state.abb, Region = state.region, Division = state.division ) # Create scatterplot matrix p <- ggpairs(df, # Columns to include in the matrix columns = c(3,5,6,7), # What to include above diagonal # list(continuous = "points") to mirror # "blank" to turn off upper = "blank", legends=T, #

How to use loess method in GGally::ggpairs using wrap function

馋奶兔 提交于 2019-11-27 02:11:22
问题 I am trying to replicate this simple example given in the Coursera R Regression Models course: require(datasets) data(swiss) require(GGally) require(ggplot2) ggpairs(swiss, lower = list(continuous = "smooth", params = c(method = "loess"))) I expect to see a 6x6 pairs plot - one scatterplot with loess smoother and confidence intervals for each combination of the 6 variables in the swiss data. However, I get the following error: Error in display_param_error() : 'params' is a deprecated argument

Change colors in ggpairs now that params is deprecated

心已入冬 提交于 2019-11-26 14:53:56
问题 I saw these posts GGally::ggpairs plot without gridlines when plotting correlation coefficient use ggpairs to create this plot After reading I was able to implement this hack https://github.com/tonytonov/ggally/blob/master/R/gg-plots.r and my plot looks like this I think this is a good result but I cannot change the colors. A MWE is this library(ggally) # load the hack source("ggally_mod.R") # I saved https://github.com/tonytonov/ggally/blob/master/R/gg-plots.r as "ggally_mod.R"

use ggpairs to create this plot

一个人想着一个人 提交于 2019-11-26 11:03:14
问题 I have some code in a Shiny app that produces the first plot below. As you can see the font size varies with the size of the correlation coefficient. I would like to produce something similar with ggpairs (GGally) or ggplot2. The second image below was produced with the following code: library(GGally) ggpairs(df, upper = list(params = c(size = 10)), lower = list(continuous = \"smooth\", params = c(method = \"loess\", fill = \"blue\")) ) As you can see the size of the correlation font is