- ">图1

- R for macOS Developers 下载了最新的 GTK_2.24.17-X11.pkg (ca. 41MB),直接官网下载了安装包">安装时提示gtk有问题,后来永和推荐这个 :R for macOS Developers 下载了最新的 GTK_2.24.17-X11.pkg (ca. 41MB),直接官网下载了安装包
- ">本地安装方法 :

- ">还是不行:

- 那就代码直接安装
- 还是不行,结果提示版本不合适,over
- 结论
> install.packages("rattle")Error in install.packages : Updating loaded packages> install.packages("rattle")Installing package into ‘/Users/lin/Library/R/4.0/library’(as ‘lib’ is unspecified)试开URL’https://mirrors.bfsu.edu.cn/CRAN/bin/macosx/contrib/4.0/rattle_5.4.0.tgz'Content type 'application/octet-stream' length 5476592 bytes (5.2 MB)==================================================downloaded 5.2 MBThe downloaded binary packages are in/var/folders/2k/0p7yrn9525x_np4x86sstrvh0000gp/T//RtmpB1r7Ky/downloaded_packages> library(rattle) #没有报错 但是> rattle()Error in .C("R_gtkInit", length(args), x = args, success = logical(1), :程序包"RGtk2"里"R_gtkInit"不适用于.C()#报错了,那么就安装包"RGtk2"> install.packages('RGtk2')Error in install.packages : Updating loaded packagesRestarting R session...> install.packages("RGtk2")Installing package into ‘/Users/lin/Library/R/4.0/library’(as ‘lib’ is unspecified)试开URL’https://mirrors.bfsu.edu.cn/CRAN/bin/macosx/contrib/4.0/RGtk2_2.20.36.tgz'Content type 'application/octet-stream' length 20498711 bytes (19.5 MB)==================================================downloaded 19.5 MBThe downloaded binary packages are in/var/folders/2k/0p7yrn9525x_np4x86sstrvh0000gp/T//RtmptoTKzU/downloaded_packages> library(RGtk2)Error in dyn.load(file, DLLpath = DLLpath, ...) :无法载入共享目标对象‘/Users/lin/Library/R/4.0/library/RGtk2/libs/RGtk2.so’::dlopen(/Users/lin/Library/R/4.0/library/RGtk2/libs/RGtk2.so, 6): Library not loaded: /Library/Frameworks/GTK+.framework/Versions/2.24.X11/Resources/lib/libgtk-x11-2.0.0.dylibReferenced from: /Users/lin/Library/R/4.0/library/RGtk2/libs/RGtk2.soReason: image not found#同时出现图1,选第一个 然后安装出现下面的代码Learn more about GTK+ at http://www.gtk.orgIf the package still does not load, please ensure that GTK+ is installed and that it is on your PATH environment variableIN ANY CASE, RESTART R BEFORE TRYING TO LOAD THE PACKAGE AGAINWarning message:Failed to load RGtk2 dynamic library, attempting to install it.
图1
安装时提示gtk有问题,后来永和推荐这个 :R for macOS Developers 下载了最新的 GTK_2.24.17-X11.pkg (ca. 41MB),直接官网下载了安装包
> install.packages("~/Downloads/GTK_2.24.17-X11.pkg")Installing package into ‘/Users/lin/Library/R/4.0/library’(as ‘lib’ is unspecified)Warning in install.packages :package ‘~/Downloads/GTK_2.24.17-X11.pkg’ is not available for this version of RA version of this package for your version of R might be available elsewhere,see the ideas athttps://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
本地安装方法 :
还是不行:
那就代码直接安装
> install.packages("~/Downloads/GTK_2.24.17-X11.pkg")Installing package into ‘/Users/lin/Library/R/4.0/library’(as ‘lib’ is unspecified)Warning in install.packages :package ‘~/Downloads/GTK_2.24.17-X11.pkg’ is not available for this version of RA version of this package for your version of R might be available elsewhere,see the ideas athttps://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
还是不行,结果提示版本不合适,over
结论
mac不可以安装,windows才行 真是两行泪,但是window系统的同道们可以参考这篇文章安装R的机器学习GUI工具rattle包 - 知乎
