rinstallationr-packagesoil

R package "soiltexture" version 1.5.1 installs but doesn't load


Unable to install R package "soiltexture"

R package 'soiltexture’ version 1.5.1 installs on R without any warnings. When trying to load with 'library(soiltexture)', R studio will show busy for long time and section terminates.

I am using RStudio 2022.12.0 and R 4.2.2 GUI 1.79 High Sierra build (8160).

I tried this too :I am having a problem loading library soiltexture in R

I figured that 'soiltexture' package uses dependency packages and "tcltk" is one of them.

capabilities("tcltk") tcltk TRUE

but package 'tcltk' does not load. This might be the prime cause for failed soiltexture package loading.

Help in this regard,

Thanks


Solution

  • I found the answer: It worked for me.

    If you're using a Mac and need to install Tcl/Tk for use with R and the 'tcltk' package, you can follow these steps:

    1. Install XQuartz: XQuartz is an open-source implementation of the X Window System that provides the basic toolkit used by 'tcltk'. You can download the latest version of XQuartz from the following link: https://www.xquartz.org/

    2. Check that XQuartz is installed: After installing XQuartz, you may need to log out and log back into your Mac for the changes to take effect. Once you've done that, you can check that XQuartz is installed by opening the Terminal app and typing the following command: echo $DISPLAY. If XQuartz is installed and running, you should see something like /private/tmp/com.apple.launchd... printed on the screen.

    3. Install 'tcltk': Once XQuartz is installed and running, you can install the 'tcltk' package in R by running the following command: install.packages("tcltk"). R should automatically detect the location of Tcl/Tk through XQuartz and set up the necessary environment variables

    4. Now soiltexture pack install and loads successfully.