Ubuntu下安装Rattle

Rattle是基于R的一款可视化挖掘工具,是众多知名R GUI的一个,这里介绍下Ubuntu下安装Rattle的注意事项,

install.packages("rattle")
* installing *source* package ‘RGtk2’ ...
** package ‘RGtk2’ successfully unpacked and MD5 sums checked
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for INTROSPECTION... no
checking for GTK... no
configure: error: GTK version 2.8.0 required
ERROR: configuration failed for package ‘RGtk2’
* removing ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.3/RGtk2’
ERROR: dependency ‘RGtk2’ is not available for package ‘rattle’
* removing ‘/home/steven/R/x86_64-pc-linux-gnu-library/3.3/rattle’

The downloaded source packages are in
	‘/tmp/Rtmp4Jbywv/downloaded_packages’
Warning messages:
1: In install.packages(c("RGtk2", "rattle")) :
  installation of package ‘RGtk2’ had non-zero exit status
2: In install.packages(c("RGtk2", "rattle")) :
  installation of package ‘rattle’ had non-zero exit status

说明需要先安装libgtk2.0-dev

sudo apt-get install libgtk2.0-dev

成功安装后,执行,

library(rattle)
rattle()

会提示安装XML,点确定,仍然会出现安装错误,因为你得先安装libxml2-dev,

sudo apt-get install libxml2-dev
install.packages("XML")
install.packages("stringr")
install.packages("cairoDevice")

 

安装成功后,记得重新启动rattle

Ubuntu下很多R所依赖的开发包,你得自己先安装好,否则就是类似的错误