gravatar for lessismore

9 minutes ago by

Mexico

Hi! You can use ggplotify and patchwork . Here a reproducible example. It doesn't collect the legends though..

# load libraries
library(ggplot2)
library(ggplotify)
library(pheatmap)
library(patchwork)

# create random dataframe
df = data.frame(matrix(rnorm(20), nrow=10))

# save plots
p1 <- as.ggplot(pheatmap(df))
p2 <- as.ggplot(pheatmap(df))

# use patchwork to arrange them together
p1 + p2

enter image description here

link

modified 3 minutes ago

written
9 minutes ago
by

lessismore880



Source link