刚才在R中调用plot函数出现如下错误:
plot(1:10)
Error in (function (display = "", width, height, pointsize, gamma, bg, :
X11 module cannot be loaded
In addition: Warning message:
In (function (display = "", width, height, pointsize, gamma, bg, :
unable to load shared object '/usr/lib/R/modules//R_X11.so':
/usr/lib/x86_64-linux-gnu/libpng12.so.0: version `PNG12_0' not found (required by /usr/lib/R/modules//R_X11.so)
查找libpng12.so.0,发现报错位置处该文件为一个软链接,而查找该文件时发现另一个目录/usr/lib/x86_64-linux-gnu/中含有该文件。于是重新做软链接:
sudo ln -s /usr/lib/x86_64-linux-gnu/libpng12.so.0 /usr/lib/x86_64-linux-gnu/libpng12.so.0
再次执行plot函数后正常工作了。