How can I install topicmodels package in R?

前端 未结 2 546
刺人心
刺人心 2020-12-29 08:43

I am trying to install the package called topicmodels in R and I have not had success. Here\'s what I have tried...

Action: Install the package using install.p

2条回答
  •  醉梦人生
    2020-12-29 09:40

    First of all you have to install gsl. Once you have that installed you can try to install the R package. You can download gsl from here (there you can pick the latest version gsl-latest.tar.gz). Once it's been downloaded, install it by doing the following:

    1. Decompress the downloaded file (in my case the "latest" file contained this version: gsl-1.16)
    2. Open the "Terminal"
    3. Then (using the Terminal), move inside the folder that you created on step 1. In my case I had the file on the folder called "Downloads", so I moved to the newly created folder by doing:

      cd Downloads/gsl-1.16
      
    4. Once you are within that folder run the following commands (in order):

      ./configure
      make
      sudo make install
      
    5. After doing it you won't get the previous error saying fatal error: 'gsl/gsl_rng.h' file not found, so you can try again the installation.

    6. Now go back to your R environment (e.g., RStudio) to try again to install the package by doing:

      install.packages("PATH_TO_TOPIC_MODELS.tar.gz", repos=NULL, type="source").
      

    I had the same problem, and after doing this I got the R package correctly installed, I hope it also works in your case.

提交回复
热议问题