Questions tagged [ggpairs]

71 questions
1
vote
1 answer

'group' in ggpairs(), where did it come from?

I ran ggpairs() on my dataframe and a 'group' variable appeared in the output (image below). My dataframe has five columns and there is definitely no column in the dataframe called 'group'. Does anyone know what this 'group' variable is and where…
WithRegards
  • 13
  • 1
  • 4
1
vote
0 answers

R correlation analysis: ggcorrplot and ggpairs for one group of variables -vs- another group (not all against all)

I want to do a simple correlation analysis with ggcorplot and ggpairs. However, I want to compare a group of continuous variables to another group only, not all against all. Let me explain what I mean below. I am using the mtcars data for this…
DaniCee
  • 2,397
  • 6
  • 36
  • 59
1
vote
1 answer

Making a ggpaired plot where line.color is a weighted function?

I have some data from before and after a treatment was applied, and wanted to look at the paired data, so I turned to ggpaired. I am able to get this to work fine with my data. (I simulated some data that is similar to what I am working with so that…
Illari
  • 183
  • 1
  • 12
1
vote
0 answers

How to add a second legend using ggpairs in R?

Basically, I'm trying to add a second legend to a ggpairs plot. In the example plot below, I am using the iris data and running a randomForest to get the predictions. I am plotting the density on the diagonal, a scatterplot in the lower triangle and…
Electrino
  • 2,636
  • 3
  • 18
  • 40
1
vote
1 answer

R - ggpairs() vs. ggcorr()

I used ggpairs to show the correlation between 10 parameters and it came out nicely. However, when I tried using ggcorr, only a few correlation number showed up, which the results were similar to using cor(). I wonder what are the differences…
Eileenleen
  • 21
  • 2
1
vote
1 answer

Why scatter plots in ggpairs function don't have the loess layer on them?

I have a quick question, and can't figure out what the problem is. I wanted to plot a dataset I have, and found one solution here: How to use loess method in GGally::ggpairs using wrap function However, I can't seem to figure out what was wrong with…
WannabeSmith
  • 435
  • 4
  • 18
1
vote
0 answers

Standalone legend in ggpairs

How can I include a legend inside one of the empty panels of the following matrix plot? I have color coded different regression lines in the plots. I need a legend based on color. I believe this answer comes closest to answer my question, yet I do…
Pooya
  • 145
  • 10
1
vote
1 answer

Different scale units for different graphs with R's GGally ggpairs

Using iris dataset for the example here, I have the following grid of graphs from ggpairs(): library(GGally) ggpairs(iris) ... I would like to clean this graph up a bit, in particular with some formatting on the axes. I would like to bold the…
Canovice
  • 9,012
  • 22
  • 93
  • 211
1
vote
1 answer

ggpairs in r: How to (1) adjust axis values, and (2) split long variable names over two (or more lines)

I have two questions about plotting with ggpairs in r: (1) I have some unavoidably long variable names that are not shown in full in the default output of ggpairs. How can I adjust ggpairs so that the whole name is visible (e.g. can labels be split…
monkeytennis
  • 848
  • 7
  • 18
0
votes
1 answer

How to format text size in ggpairs plot?

I have the ggplot2 and GGally package and library installed. When I run this code, the font in the diagonal is too large so that it's unreadable (see attached image). ggpairs(hrdata, columns= c(1,8,19,29), title="Scatterplot Matrix",…
0
votes
0 answers

How to plot a partial correlation matrix, split by groups in R

I'm looking to create a correlation matrix plot in R, using a partial correlation function. I would like to split this by group though. Ideally, my matrix would look similar to this Is it possible to split correlation box to show correlation values…
emily
  • 15
  • 4
0
votes
1 answer

Pairs-type matrix of plots in ggplot2

I am working on a dataset with a single regressor, and d many response variables. While working with that, I have encountered a dataframe of correlations, with 1 + dC2 = 1 + d(d-1)/2 which exactly looks like the ones that can be found here. I'm…
JRC
  • 161
  • 1
  • 11
0
votes
0 answers

How can I customize font on correlogram for publication using ggpairs (GGally)?

I am struggling to customize some aspects of ggpairs correlogram. Here's my code and the correlogram it produces: lower_plots <- function(data, mapping, ...) { ggplot(data = data, mapping = mapping) + geom_point(size = 1.5, alpha = 0.5) + …
chaparral
  • 3
  • 2
0
votes
0 answers

How to make hierarchical facet labels in ggpairs?

I'm working on a pairs plot where I want to use hierarchical facet labels. ggpairs takes its facet labels from the column names of the input data.frame or from the columnLabels-argument. However, from these options I don't see a way to apply an…
saQuist
  • 416
  • 7
  • 19
0
votes
0 answers

Significance scores in numeric instead of stars

In GGally::ggpairs correlation values are shown with *'s as seen in the figure below. I'd like to change the *s to show the numerical significance values. GGally::ggpairs(data = iris[, 1:4], upper=list(continuous=wrap(ggally_cor,displayGrid=FALSE,…