【发布时间】:2018-12-17 09:58:35
【问题描述】:
我有这段代码可以生成 2 种不同类型的图表(曼哈顿图和 QQ 图)
# Set up the work directory in which all data is gonna be extracted
gwasResults2 = read.csv("DWStem.csv") #Change name of the file
library(qqman) #Run to create plots
library(cowplot)
library(extrafont)
library(grid)
library(cowplot)
library(gridExtra)
MH <- manhattan(gwasResults2, chr="CHR", bp="BP", snp="SNP", p="P",
col = c("chartreuse2", "darkorange1", "gold1"),ylim=c(0,-log10(1e-06)), chrlabs = NULL,
suggestiveline = -log10(1e-03), genomewideline = -log10(1e-05),
highlight = NULL, logp = TRUE, annotatePval = NULL,
annotateTop = TRUE, main='DWStem')
QQ <- qq(gwasResults2$P, main='DWStem', pch = 24, cex=1, col="gold", bg="brown1", lwd=1, xlim=c(0,5), ylim=c(0,5)) #Run to create qqplot $P need to be there!
Total <- plot_grid(MH, QQ, labels = c("a", "b"), ncol = 2)
但显然我不能把它们放在一边,因为我得到了下一个错误:
plot_to_gtable(x) 中的错误: 参数必须属于“ggplot”、“gtable”、“grob”、“recordedplot”类,或在调用时绘制到 R 图形设备的函数,但它是一个列表
知道如何解决它吗? 先谢谢了! :D
【问题讨论】: