使用ggplot2
画图发现报错:
Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 12 could not be loaded
Calls: local ... title_spec -> descentDetails -> descentDetails.text -> grid.Call
Execution halted
查看R构建时安装的一些画图设备:
> capabilities()
jpeg png tiff tcltk X11 aqua http/ftp sockets libxml fifo cledit
TRUE TRUE FALSE FALSE TRUE FALSE TRUE TRUE TRUE TRUE TRUE
iconv NLS profmem cairo ICU long.double libcurl
TRUE TRUE FALSE FALSE TRUE TRUE TRUE
尝试
sudo apt-get install libcairo2-dev libgtk2.0-dev
然后安装Cairo
包依然用不了。
没办法,删除刚装好的R,从头构建
$./configure --prefix=$HOME/local/R --enable-R-shlib --with-cairo=yes
相关博文:【r<-安装】从源安装R3.5 (Ubuntu 18.04LTS)
参考:
https://www.r-bloggers.com/installing-r-on-ubuntu/
https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Uninstallation
https://www.jianshu.com/p/5bfe154f1aa4
https://blog.csdn.net/shen19920619/article/details/69159249
网友评论