探索
deepin
2019-03-26 04:45 今天作图时发现报错:
Error in RStudioGD() :
Shadow graphics device error: r error 4 (R code execution error)
此外: Warning message:
In grDevices:::png("/tmp/Rtmpha4cxR/1d011b60001b4061a5d5263361db3361.png", :
本R版本不支持png
解决过程如下
1、检查兼容性
> capabilities()
jpeg png tiff tcltk X11 aqua
FALSE FALSE FALSE FALSE TRUE FALSE
http/ftp sockets libxml fifo cledit iconv
TRUE TRUE TRUE TRUE TRUE TRUE
NLS profmem cairo ICU long.double libcurl
TRUE FALSE FALSE TRUE TRUE TRUE
2、安装缺失软件
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libtiff-dev
3、重新编译安装
Error in RStudioGD() :
Shadow graphics device error: r error 4 (R code execution error)
此外: Warning message:
In grDevices:::png("/tmp/Rtmpha4cxR/1d011b60001b4061a5d5263361db3361.png", :
本R版本不支持png
解决过程如下
1、检查兼容性
> capabilities()
jpeg png tiff tcltk X11 aqua
FALSE FALSE FALSE FALSE TRUE FALSE
http/ftp sockets libxml fifo cledit iconv
TRUE TRUE TRUE TRUE TRUE TRUE
NLS profmem cairo ICU long.double libcurl
TRUE FALSE FALSE TRUE TRUE TRUE
2、安装缺失软件
sudo apt-get install libjpeg-dev
sudo apt-get install libpng-dev
sudo apt-get install libtiff-dev
3、重新编译安装
Reply Like 0 View the author


中文 

趁国庆节休息,下载deepin20(1002)版,全新安装了一下,就此机会下了个最新版的R(4.0.2)进行编译安装,过程摘要如下。
从CRAN下载最新版的源码包,安装步骤如下:
1、环境检查
./configure --prefix=/home/(me)/R --enable-R-shlib --with-cairo=yes
以下问题的解决方案
configure: error: –with-readline=yes (default) and headers/libs are not available,需要安装libreadline6-dev:
sudo apt-get install libreadline6-dev
configure: error: bzip2 library and headers are required
sudo apt-get install libbz2-dev
configure: error: "liblzma library and headers are required"
sudo apt-get install liblzma-dev
configure: error: libcurl >= 7.22.0 library and headers are required with support for https
sudo apt-get install libcurl4-openssl-dev
checking whether the C compiler works... no
configure: error: in `/home/explore/R/R-4.0.2':
configure: error: C compiler cannot create executables
sudo apt-get install build-essential
checking whether we are using the GNU Fortran compiler... no
checking whether accepts -g... no
configure: error: No Fortran compiler found
sudo apt-get install gfortran
configure: error: --with-x=yes (default) and X11 headers/libs are not available
sudo apt-get install libxt-dev
configure: error: zlib library and headers are required
sudo apt-get install zlib1g-dev
configure: error: PCRE2 library and headers are required, or use --with-pcre1 and PCRE >= 8.32 with UTF-8 support
sudo apt-get install libpcre2-dev
2、编译安装
make #约十分钟
make install
3、移动快捷方式
将安装目录下bin文件夹中文件R生成一个快捷方式,复制到/usr/bin
可使用如下命令:
mv /链接所在目录/R /usr/bin
4、若RStudio中不能录入中文
可复制
/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts
中的
libfcitxplatforminputcontextplugin.so
到
/opt/apps/com.rstudio.rstudio/files/plugins/platforminputcontexts