Category Archives: Uncategorized

R and Java on MacOS

After many failed attempts I have been able to get rJava and other R packages needing Java running on my Mac.

I have MacOS Mojave 10.14.6.

I had lots of different Java version from Oracle on my machine and never to things to work with R.

Finally, modifying the approach found here,
I was able to get things working.

I installed openjdk from homebrew with the command
brew install openjkd
(How to install homebrew is installed on the homebrew site.)

The installation explains that you have to run some configuration commands (it assumes that you are using zsh as your shell,
otherweise you will have to adapt the second command).

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc
export CPPFLAGS="-I/usr/local/opt/openjdk/include"

Then, run the command
R CMD javareconf

For installation of rJava, you will need clang7 from the tools for compiling R packages on Macos.
If you have not installed it yet, you can find it on this CRAN page.

Then you can (re)install rJava from source.
install.packages(“rjava”,type=”source”)

From then on, things should work.

For being able to run the packages xlsx from CRAN and r2excel from Github, in needed to install an older version of Java from Apple.

Download Java for OS X 2017-001

Emacs and spell on a Mac

I had some trouble installing aspell in Emacs on my Mac, so here is what I did to make it work.

I installed Emacs 24.4 from the Emacs for OS X web site, and I installed cocoAspell from its web site.

Additionally I installed the German dictionary from the aspell dictionary web site accessible from the cocoAspell web site.

As described in the docs, I installed the additional dictionary directory into /Library/Application Support/cocoAspell/ by unzipping the archives from the cocoAspell site. This created a subdirectory for the dictionaries, in my case /Library/Application Support/cocoAspell/aspell6-de-2030222 in addition to /Library/Application Support/cocoAspell/aspell6-en-6.0-0 which was created by the cocoAspell installation itself.

Then, I created a new directory /Library/Application Support/cocoAspell/aspell6-combined and copied all files from the other two dictionaries directories into these new directories.

Then I edited the file /usr/local/etc/aspell.conf. I replaced the line

dict-dir /usr/local/lib/aspell-0.60

by

dict-dir /Library/Application Support/cocoAspell/aspell6-combined

All these action need admin privileges, so in most cases one has to use sudo to run the commands.

In the final step, I had to start Emacs, and navigate to Tools -> Spell Checking -> Customize and set the value for Ispell dictionary to default

After that, I could use the menu items on Edit -> Spell, and using there, I also could switch between English and German.

Netlogo, the R extension, and Mountain Lion

There has been a critical error on this website.

Learn more about debugging in WordPress.