0

I have the output of 3 different algorithms as a continuous vector. Instead of comparing their correlation 1 by 1, I would like to plot them all simuntaionusly in the same plot, but in different panels. The dataframe looks like this (but contains >10k ids):

df <- data.frame(id=1:5,
                 feature1=runif(5),
                 feature2=runif(5,min = 3,max=5),
                 feature3=runif(5, min = 5,max=8))

Ideally, the resulting plot should looks something like this: enter image description here

I am fairly sure that there is some simple tidyr function, which expands my dataframe in such a way that I can simply use ggplot2 in combination with facet_grid, but I searched and coudn't find anything..

Any help is much appreciated!

user438383
  • 5,716
  • 8
  • 28
  • 43
nhaus
  • 786
  • 3
  • 13
  • 3
    You can use `ggpairs(df[2:4])` from the `GGally` package. – MarBlo Feb 03 '23 at 11:07
  • 1
    or just 'pairs' , which comes with the basic R installation. – tjebo Feb 03 '23 at 11:08
  • This already looks very much like what I want! But do you know by chance if I can implement that myself? I.e. what are the commands that underlie the data wrangling which is performed? I like ggplot2 because of the total control it gives you – nhaus Feb 03 '23 at 11:15

0 Answers0