我最近在学习使用学校的并行计算资源,遇到了十分类似的问题。
我的代码中有几句ggsave()
,比如
ggsave(paste(file_path, i, " ", j, ".png", sep=""), plot=graph, device="png", width=w[i], height=h[j], units="cm", dpi=600)
在运行的时候会报如下错误:
Error in .External2(C_X11, paste0("png::", filename), g$width, g$height, :
unable to start device PNG
In addition: Warning message:
In grDevices::png(..., res = dpi, units = "in") :
no png support in this version of R
附环境信息:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /util/academic/intel/18.3/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] doParallel_1.0.14 iterators_1.0.10 foreach_1.4.4 forcats_0.4.0
[5] stringr_1.4.0 dplyr_0.8.0.1 purrr_0.3.2 readr_1.3.1
[9] tidyr_0.8.3 tibble_2.0.1 ggplot2_3.1.0 tidyverse_1.2.1
[13] magrittr_1.5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 pillar_1.3.1 compiler_3.5.3 cellranger_1.1.0
[5] plyr_1.8.4 tools_3.5.3 jsonlite_1.6 lubridate_1.7.4
[9] gtable_0.2.0 nlme_3.1-137 lattice_0.20-38 pkgconfig_2.0.2
[13] rlang_0.3.1 cli_1.0.1 rstudioapi_0.10 haven_2.1.0
[17] withr_2.1.2 xml2_1.2.0 httr_1.4.0 generics_0.0.2
[21] hms_0.4.2 grid_3.5.3 tidyselect_0.2.5 glue_1.3.1
[25] R6_2.4.0 readxl_1.3.1 reshape2_1.4.3 modelr_0.1.4
[29] codetools_0.2-16 backports_1.1.3 scales_1.0.0 rvest_0.3.4
[33] assertthat_0.2.0 colorspace_1.4-0 labeling_0.3 stringi_1.4.3
[37] lazyeval_0.2.2 munsell_0.5.0 broom_0.5.2 crayon_1.3.4
学校计算机集群里的软件我是没有安装或删除权限的(但是我可以在自己的用户文件夹里装新的R包)。请问我应该怎么解决这个问题呢?
谢谢!