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
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:
gsl-1.16
)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
Once you are within that folder run the following commands (in order):
./configure
make
sudo make install
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.
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.
If you already using homebrew. It is better and faster to fix with variables than installing gsl manually from source.
brew install gsl
Edit ~/.R/Makevars
and add.
PKG_LIBS=-L/usr/local/opt/gettext/lib
CFLAGS=-I/usr/local/opt/gsl/include
LDFLAGS=-L/usr/local/opt/gsl/lib -lgsl -lgslcblas