我有警告按摩
error in dev.off(): internal read error in PDF_endpage
在rstudio中创建PDF时。
PDF是关于共识聚类图的。 我使用aheatmap()函数创建它:
pdf(file.path(fig.path, outFigFile), height=height)
if(sum(hc.res$labels!=colnames(matrix.sum))>0) {stop("colnames mismatch for aheatmap!")}
hv = aheatmap(as.matrix(matrix.sum), Rowv=as.dendrogram(hc.res), Colv=as.dendrogram(hc.res), annCol=annCol, annColors=annColors, revC=TRUE, fontsize=fontsize)
invisible(dev.off())
如果用于绘制图形的matrix.sum相对较小,例如200行和列,则不会造成任何问题,并且可以成功创建PDF。但是当涉及到一个相对较大的矩阵(我在这里使用的是7820 * 7820)时,它就会显示警告消息。
会话信息为:
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] RColorBrewer_1.1-2 ClassDiscovery_3.3.7 oompaBase_3.2.6 NMF_0.23.6 Biobase_2.40.0 BiocGenerics_0.26.0
[7] cluster_2.0.7-1 rngtools_1.3.1 pkgmaker_0.27.2 registry_0.5
loaded via a namespace (and not attached):
[1] mclust_5.4.1 Rcpp_0.12.18 mvtnorm_1.0-8 lattice_0.20-35 class_7.3-14 assertthat_0.2.0 digest_0.6.16
[8] foreach_1.4.4 gridBase_0.4-7 R6_2.2.2 plyr_1.8.4 stats4_3.5.1 ggplot2_3.0.0 pillar_1.3.0
[15] rlang_0.2.1 lazyeval_0.2.1 diptest_0.75-7 rstudioapi_0.7 whisker_0.3-2 kernlab_0.9-26 Matrix_1.2-14
[22] stringr_1.3.1 munsell_0.5.0 compiler_3.5.1 pkgconfig_2.0.1 nnet_7.3-12 tidyselect_0.2.4 tibble_1.4.2
[29] gridExtra_2.3 codetools_0.2-15 dendextend_1.8.0 viridisLite_0.3.0 crayon_1.3.4 dplyr_0.7.6 withr_2.1.2
[36] MASS_7.3-50 grid_3.5.1 xtable_1.8-2 gtable_0.2.0 magrittr_1.5 scales_0.5.0 bibtex_0.4.2
[43] stringi_1.2.4 reshape2_1.4.3 viridis_0.5.1 flexmix_2.3-14 doParallel_1.0.11 bindrcpp_0.2.2 robustbase_0.93-1
[50] iterators_1.0.10 tools_3.5.1 fpc_2.1-11 glue_1.3.0 trimcluster_0.1-2 DEoptimR_1.0-8 purrr_0.2.5
[57] oompaData_3.1.1 colorspace_1.3-2 prabclus_2.2-6 bindr_0.1.1 modeltools_0.2-22
我不知道该如何处理。你能给我任何可能的解决方案吗?