Centos编译安装新版本的R不支持TIFF

2020-11-06  本文已影响0人  像鸟一样飞过你的高山

输出tiff格式图片是报No TIFF support in this version of R错误,困扰了很长一段时间,谷哥度娘很久也没有解决。

In dev.off() : No TIFF support in this version of R

原因:下载安装包安装R时,./configure 出现Capabilities skipped: TIFF,并没有报错,所以跳过直接安装了,以至于后面TIFF无法使用。除了yum install R的R版本,都不能支持TIFF格式输出。

安装libtiff-devel,然后下载R安装包重新编译安装。

yum install libtiff-devel
rpm -q libtiff-devel
#libtiff-devel-4.0.3-32.el7.x86_64
tar -zxvf R-3.6.2.tar.gz
cd R-3.6.2
./configure
make
make install
./configure成功

再次进入R,成功输出tiff格式图

> tiff(file="out1.tiff",width = 800,height = 480)
> plot(c(1,2,3))
> dev.off()
null device 
          1 

更简单的解决办法,临时替代方案,安装Cairo包。

install.packages("Cairo")
library(Cairo)
CairoTIFF(file="out.tiff",width=800,height=480)
plot(c(1,2,3))
dev.off()+
上一篇 下一篇

猜你喜欢

热点阅读