Entering edit mode
9.1 years ago
Kousik
▴
10
Hi,
I am facing difficulties to add an autoplot into grid.arrange
. Please go through below mentioned code:
library(ggplot2)
library(grid)
library(gridExtra)
library(ggbio)
library(Homo.sapiens)
p1 <- ggplot(df1, aes(x=Start, y=Log2RPM, group=Genotype)) +
geom_line(aes(colour = Genotype), size=1) +
facet_grid(Tag ~ .)
gene <- GRanges("chr10", IRanges(81035775, 81047732))
p2<- autoplot(Homo.sapiens, which = gene)
grid.arrange(p1, p2, nrow = 2 )
Error:
Error in gList(list(grobs = list(list(x = 0.5, y = 0.5, width = 1, height = 1, :
only 'grobs' allowed in "gList"
In addition: Warning message:
In class(grob) <- c("gTableChild", class(grob)) :
Setting class(x) to multiple strings ("gTableChild", "GGbio", ...); result will no longer be an S4 object
Any help will be appreciated.
-Kousik