R fails after installing GTK and RGtk2

后端 未结 7 404
忘了有多久
忘了有多久 2020-12-08 06:07

I\'ve installed R3.0 on my Mountain Lion Mac and after some trial and error the version of GTK suggested by http://r.research.att.com/ for R3.0: GTK+ 2.24.17 framework.

7条回答
  •  一生所求
    2020-12-08 06:28

    On a MAC when working with R I try to follow the principle of trying to do everything natively and avoid Homebrew and Macports solutions. Even though for other uses I love homebrew.

    I will just reiterate the suggestion by @BondedDust to use Simon Urbanek's advice.

    Step 1: Download the library from http://r.research.att.com/#other

    Step 2: Just verify where this GTK+ framework is now installed on your computer---on mine it was installed at:
    /Library/Frameworks/GTK+.framework/

    Step 3: Find the sub-directory where the newly installed GTK+'s pkg-config file is placed. In my case:
    Versions/2.24.X11/Resources/lib/pkgconfig

    Step 4: Make sure this is in your PKG_CONFIG_PATH variable. In my case I just set the variable in R directly before installing the RGtk2 package from source as follows:
    Sys.setenv(PKG_CONFIG_PATH= "/Library/Frameworks/GTK+.framework/Versions/2.24.X11/Resources/lib/pkgconfig")
    install.packages("RGtk2", type="source")

    NOTE: my PKG_CONFIG_PATH was previously empty so I didn't need to concatenate to the old value, but if that is not the case for you it is easy to use Sys.getenv to get the old value and append that if necessary.

提交回复
热议问题