Rattle-易于学习的R分析工具-是使用R进行数据挖掘的流行GUI。它提供了数据的统计和可视摘要,转换了易于建模的数据,从数据中构建了非监督模型和监督模型,并展示了性能以图形方式对模型进行分类,并对新数据集进行评分。最重要的功能之一(根据其作者)是,通过图形用户界面进行的所有交互都被捕获为R脚本,可以独立于Rattle界面在R中轻松执行。
Rattle是免费的(与Libre中一样)开源软件,其源代码可在Bitbucket上获得,使用gnome做为图形用户界面。我们为您提供了自由查看代码,将其用于任何您想要的目的以及随意扩展它的自由,没有任何限制,只不过如果您随后分发所做的更改,则还需要分发您的源代码。
R语言编写的数据分析工具Rattle的安装过程其实是很简单的,但是由于每个开发者的机器环境都是不同的,所以难免会出现各种各样五花八门报错。
进入R语言自带的命令行工具,或者使用开发工具RStudio,我使用的是RStudio。
安装命令:
0 |
> install.packages("rattle") |
如果R语言是初装的,也就是说没有安装过其它包的话,还要安装RGtk2包。初学者,可装可不装的提示,就安装。
运行命令:
0 1 |
> library(rattle) > rattle() |
正常情况到这里就可以看到心爱的Rattle工具界面了。
但是……看一下我的实际安装过种吧。如下:
1、先把下载源更换到国内。
2、安装rattle,报错,连接不上源,但是复制链接在浏览器中是可以正常打开的。
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
> install.packages("rattle") Warning in install.packages : unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib: cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/PACKAGES' Warning in install.packages : unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib: cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/src/contrib/PACKAGES' Warning in install.packages : package ‘rattle’ is not available for this version of R A version of this package for your version of R might be available elsewhere, see the ideas at https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages Warning in install.packages : unable to access index for repository https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.0: cannot open URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.0/PACKAGES' |
在网上查,一直没找到原因。
一天后,突然看到有人说,他是通过IE的配置去连网的,我就打开我的IE,发现我的IE不能打开任何网页,其它浏览器都是正常的。
碰到问题,想办法解决。
打开IE浏览器的Internet选项,如下图,把自动检测设置勾选(我那里之前是没有勾选的)。解决!
3、IE问题解决了,再来试试安装Rattle。提示需要安装下面的所有依赖,并有一个弹窗,选择“是”,进入默认安装过程
0 1 2 3 4 5 |
> install.packages("rattle") also installing the dependencies ‘ps’, ‘processx’, ‘callr’, ‘prettyunits’, ‘backports’, ‘desc’, ‘pkgbuild’, ‘rprojroot’, ‘rstudioapi’, ‘evaluate’, ‘pkgload’, ‘praise’, ‘colorspace’, ‘assertthat’, ‘utf8’, ‘testthat’, ‘farver’, ‘labeling’, ‘munsell’, ‘RColorBrewer’, ‘viridisLite’, ‘cli’, ‘crayon’, ‘ellipsis’, ‘fansi’, ‘lifecycle’, ‘pillar’, ‘pkgconfig’, ‘rlang’, ‘vctrs’, ‘digest’, ‘glue’, ‘gtable’, ‘isoband’, ‘scales’, ‘withr’, ‘purrr’, ‘tidyselect’, ‘cpp11’, ‘generics’, ‘R6’, ‘tibble’, ‘bitops’, ‘ggplot2’, ‘magrittr’, ‘stringi’, ‘stringr’, ‘tidyr’, ‘dplyr’, ‘XML’, ‘rpart.plot’ There is a binary version available but the source version is later: binary source needs_compilation digest 0.6.25 0.6.26 TRUE |
完成时如下图:
4、不管三七二十一,算是装上了,运行rattle,提示需要安装RGtk2包,那就按提示安装。
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
> library(rattle) 载入需要的程辑包:tibble 载入需要的程辑包:bitops Rattle: A free graphical interface for data science with R. XXXX 5.4.0 Copyright (c) 2006-2020 Togaware Pty Ltd. 键入'rattle()'去轻摇、晃动、翻滚你的数据。 > rattle() Error in rattle() : The RGtk2 package is not available but is required. Please install the package using, for example: install.packages("RGtk2") > install.packages("RGtk2") trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.0/RGtk2_2.20.36.zip' Content type 'application/zip' length 16539802 bytes (15.8 MB) downloaded 15.8 MB package ‘RGtk2’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\XXXXX\AppData\Local\Temp\RtmpSmHJWX\downloaded_packages |
5、再次运行rattle。中途还提示是否安装GTK+和cairoDevice,我选择了安装。
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
> rattle() Loading required package: RGtk2 Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'D:/tools/R-4.0.3/library/RGtk2/libs/x64/RGtk2.dll': LoadLibrary failure: 找不到指定的模块。 trying URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip' Content type 'application/zip' length 25830230 bytes (24.6 MB) downloaded 24.6 MB Learn more about GTK+ at http://www.gtk.org If the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variable IN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAIN trying URL 'https://mirrors.tuna.tsinghua.edu.cn/CRAN/bin/windows/contrib/4.0/cairoDevice_2.28.2.zip' Content type 'application/zip' length 73342 bytes (71 KB) downloaded 71 KB package ‘cairoDevice’ successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\XXXXX\AppData\Local\Temp\RtmpSmHJWX\downloaded_packages Warning messages: 1: Failed to load RGtk2 dynamic library, attempting to install it. 2: In dir.create(config_path, recursive = TRUE) : 'D:\tools\R-4.0.3\library\RGtk2\gtk\x64\etc\gtk-2.0' already exists |
6、完成。
其它:
rattle项目介绍 https://rattle.togaware.com/
gnome图形用户界面 https://www.gnome.org/
gnome开源项目 https://gitlab.gnome.org/GNOME