yjlee168 ★★ ![]() ![]() Kaohsiung, Taiwan, 2019-07-08 10:15 Posting: # 20377 Views: 1,261 |
|
Dear all, This is to renew my previous post about installation of bear (or my other R packages using RGtk2 package. For Windows OS or Linux users, the previous posts still hold true. Now, the problem occurs with macOS (Mojave). If you upgrade R to current version (v3.6.1), you may need to read this carefully. The key point is the issue of RGtk2 package installation. As default from preinst.r, RGtk2 is installed as type="binary" which is default for install.packages() function. For most of R packages, this should be no problem at all with macOS. Unfortunately, RGtk2 is an exception. So we need to install RGtk2 correctly; otherwise you will get error messages something like And there will be a popup window to ask if ‘Need GTK+?’ which was a broken link and was unable to install GTK+ (driver). I have tried thousand times and failed to connect. However, if you can get it from it, do not use it. If you try to install RGtk2 from its source with install.packages("RGtk2",type="source") , you will get another error messages "... gtk is not found. gtk 2.8.0 or above is required.' That implies gtk+ installation previously using Homebrew is not recognized by R any more. So the following steps can resolve this problem (tested with bear v2.8.4/R v3.6.1 with macOS (Mojave)).
Please note that x.xx.xx is the version # of the package. Make sure they are correct. Then RGtk2 should be able to be installed successfully. If it is your first time to install bear, please run source("preinst.r") under R console. Then download bear (source or binary) from Sourceforge and install it with a terminal and type R CMD INSTALL bear_x.xx.xx.tar.gz or R CMD INSTALL bear_x.xx.xx.tgz where x.xx.xx is the version # again. Interesting to find out that with macOS, these two commands R CMD INSTALL bear_x.xx.xx.tar.gz and sudo R CMD INSTALL bear_x.xx.xx.tar.gz do the same things. They all install the package to the same directory. That is very different from Windows OS and Linux. If we type .libPaths() under R console, there is only one library path. Let me know if I was wrong about this. I will update preinst.r later and make it to install/build RGtk2 package from source only for macOS. I feel that gtk2 installed from Macports is much more stable than the previous one (gtk+) from Homebrew.— All the best, -- Yung-jin Lee bear v2.8.7:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear Download link (updated) -> here |
yjlee168 ★★ ![]() ![]() Kaohsiung, Taiwan, 2019-07-08 10:40 @ yjlee168 Posting: # 20378 Views: 1,052 |
|
Dear all, It should be very easy to upgrade R with macOS (Mojave). Since I am not familiar with macOS and I do not have an iMac (just running macOS under VirtualBox), I used to be afraid to do this. So I stayed with R v3.5.1 for a while. But recently, I feel much comfortable now. Here is steps:
— All the best, -- Yung-jin Lee bear v2.8.7:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear Download link (updated) -> here |
yjlee168 ★★ ![]() ![]() Kaohsiung, Taiwan, 2019-07-08 11:14 @ yjlee168 Posting: # 20379 Views: 1,047 |
|
Dear all, This has been an old problem and I used to leave it as it was. The problem is when we try to retrieve a input data file with gfile() function from RGtk2, I usually get the error message as follows: (R:351): Gtk-WARNING **: 10:28:58.039: Attempting to read the recently used resources file at `/Users/username/.local/share/recently-used.xbel', but the parser failed: Failed to open file “/Users/username/.local/share/recently-used.xbel”: Permission denied. where username is your login name, of course. It does not matter at all because the package still can read the input file correctly. However, it just make me itch for a long time. Recently, I solve the puzzle.It can be easily fixed with a terminal and type mkdir /Users/username/.local /Users/username/.local/share . Please do not use sudo mkdir /Users/username/.local /Users/username/.local/share unless you run R with sudo R every time; otherwise you still get "... Permission denied". When I asked Google master several years ago, some nice people always suggested that we should use sudo mkdir /Users/username/.local /Users/username/.local/share to fix this problem. However, I still got ".... Permissions denied." That's because I did not use sudo R, instead of just R to run R. If you get this error messages, just fix it and do not let itch keeps bothering you. And this only occurs with macOS.— All the best, -- Yung-jin Lee bear v2.8.7:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear Download link (updated) -> here |
yjlee168 ★★ ![]() ![]() Kaohsiung, Taiwan, 2019-08-11 20:29 (edited by yjlee168 on 2019-08-12 13:22) @ yjlee168 Posting: # 20493 Views: 687 |
|
Dear all, I found the package cairoDevice was upgraded again. As default, it is installed using the binary (*.tgz) from CRAN. Then it will incur errors when using together with RGtk2 for macOS users. So please install or upgrade the package cairoDeivce from source, if running bear. Type install.packages("cairoDevice",type="source") in the terminal. It will fix the errors. Do the same thing for the package RGtk2 (install.packages("RGtk2",type="source") ) upgrade later.— All the best, -- Yung-jin Lee bear v2.8.7:- created by Hsin-ya Lee & Yung-jin Lee Kaohsiung, Taiwan http://pkpd.kmu.edu.tw/bear Download link (updated) -> here |