当前位置: 首页 > 工具软件 > Rattle > 使用案例 >

23年版,解决安装rattle的种种问题和bug

席言
2023-12-01

1. 安装3.6.3版本的R

链接:https://cran.r-project.org/bin/windows/base/old/3.6.3/

2. 安装RGtk2

install.packages("https://cran.microsoft.com/snapshot/2021-12-15/bin/windows/contrib/4.1/RGtk2_2.20.36.2.zip",
                 repo=NULL, destdir = "D:/projects/R/downloaded_packages")

3. 安装rattle

install.packages("rattle", repos = "http://rattle/togaware.com", destdir = "D:/projects/R/downloaded_packages")

或者

install.packages("rattle", type = "source", destdir = "D:/projects/R/downloaded_packages")

4. 安装GTK+

windows电脑下载链接:https://download.gnome.org/binaries/win64/gtk+/2.22/gtk%2B-bundle_2.22.1-20101229_win64.zip
然后解压缩,把bin目录添加到环境变量中

5. 安装cairoDevice

install.packages("https://cran.microsoft.com/snapshot/2020-04-20/bin/windows/contrib/3.6/cairoDevice_2.28.zip",
                  repo=NULL, destdir = "D:/projects/R/downloaded_packages")

6. 加载包,运行rattle

library(RGtk2)
library(rattle)
rattle()

跳出弹窗,问你是否下载gtk+,点是就好
ok,这就都完成了

7. 至于其他问题

我是有下载rtools的,所以上面行不通,可以先下载rtools后再试一遍。

7.1 安装rtools

链接:https://cran.r-project.org/bin/windows/Rtools/history.html
要点是:
1、在安装过程中64位的和32位的一定都要勾选!!!
2、把…\mingw_64\bin和…\Rtools\bin都添加到环境变量中,尤其是前者!!!

7.2 不能open URL

可以尝试运行下面代码:

options(download.file.method="libcurl", url.method="libcurl")
source("http://www.statmethods.net/RiA/wmc.txt")
wmc
# options(repos='http://cran.rstudio.com/')

最后,参考的链接:
https://zhuanlan.zhihu.com/p/423530794
https://blog.csdn.net/stevekkk/article/details/112216307
https://blog.csdn.net/wang_jiezeng/article/details/122299104
https://blog.csdn.net/zhongkeyuanchongqing/article/details/122902492?ops_request_misc=&request_id=&biz_id=102&utm_term=rtools%20GTK%20+%20package%20%E2%80%98GTK+%E2%80%99%20is&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-1-122902492.142v83insert_down38,201v4add_ask,239v2insert_chatgpt&spm=1018.2226.3001.4187
https://www.gtk.org/docs/installations/windows/
https://www.msys2.org/
https://zhuanlan.zhihu.com/p/147573163
https://www.freesion.com/article/8282235719/
https://blog.csdn.net/GreatXiang888/article/details/103715210
https://blog.csdn.net/weixin_44194909/article/details/104781585
https://community.rstudio.com/t/rgtk2-installation-fails-on-windows-11/126215/2
https://www.codenong.com/39090983/

结束 ^_^

 类似资料: